aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apps/SetEnv.hs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--apps/SetEnv.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/SetEnv.hs b/apps/SetEnv.hs
index 18e369f..54a3cde 100644
--- a/apps/SetEnv.hs
+++ b/apps/SetEnv.hs
@@ -44,7 +44,7 @@ main = execParser parser >>= setEnv
fullDesc <> progDesc "Set environment variable"
setEnv :: Options -> IO ()
-setEnv options = engrave env varName varValue
+setEnv options = engrave varValue
where
varName = optName options
varValue = optValue options
@@ -54,6 +54,6 @@ setEnv options = engrave env varName varValue
| otherwise = Environment.CurrentUser
skipPrompt = optYes options
- engrave
- | skipPrompt = Environment.engrave
- | otherwise = Environment.engraveWithPrompt
+ engrave value = if skipPrompt
+ then Environment.engrave env varName value
+ else Environment.engravePrompt env varName value >> return ()