Skip to content

Commit 5953d5e

Browse files
committed
Log the result of the stack config set command
1 parent 28f7230 commit 5953d5e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/Stack/ConfigCmd.hs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{-# LANGUAGE FlexibleContexts #-}
22
{-# LANGUAGE OverloadedStrings #-}
33
{-# LANGUAGE ScopedTypeVariables #-}
4+
{-# LANGUAGE TemplateHaskell #-}
45

56
-- | Make changes to project or global configuration.
67
module Stack.ConfigCmd
@@ -73,7 +74,13 @@ cfgCmdSet cmd = do
7374
newValue <- cfgCmdSetValue cmd
7475
let cmdKey = cfgCmdSetOptionName cmd
7576
config' = HMap.insert cmdKey newValue config
76-
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.")
7784

7885
cfgCmdSetValue
7986
:: ( MonadIO m

0 commit comments

Comments
 (0)