We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
stack config set
1 parent 28f7230 commit 5953d5eCopy full SHA for 5953d5e
1 file changed
src/Stack/ConfigCmd.hs
@@ -1,6 +1,7 @@
1
{-# LANGUAGE FlexibleContexts #-}
2
{-# LANGUAGE OverloadedStrings #-}
3
{-# LANGUAGE ScopedTypeVariables #-}
4
+{-# LANGUAGE TemplateHaskell #-}
5
6
-- | Make changes to project or global configuration.
7
module Stack.ConfigCmd
@@ -73,7 +74,13 @@ cfgCmdSet cmd = do
73
74
newValue <- cfgCmdSetValue cmd
75
let cmdKey = cfgCmdSetOptionName cmd
76
config' = HMap.insert cmdKey newValue config
- liftIO (S.writeFile configFilePath (Yaml.encode config'))
77
+ if config' == config
78
+ then $logInfo
79
+ (T.pack configFilePath <>
80
+ " already contained the intended configuration and remains unchanged.")
81
+ else do
82
+ liftIO (S.writeFile configFilePath (Yaml.encode config'))
83
+ $logInfo (T.pack configFilePath <> " has been updated.")
84
85
cfgCmdSetValue
86
:: ( MonadIO m
0 commit comments