aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/app/RemovePath.hs
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2017-06-11 05:56:10 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2017-06-11 05:56:10 +0300
commit837e60b9d8826168896ad4155ff7046f00665f52 (patch)
tree18c40efee9f38954079119587d3b60ababf5e555 /app/RemovePath.hs
parentdelenv: ignore missing variables (diff)
downloadwindows-env-837e60b9d8826168896ad4155ff7046f00665f52.tar.gz
windows-env-837e60b9d8826168896ad4155ff7046f00665f52.zip
WindowsEnv: {VarName,VarValue} -> {Name,Value}
Also, fix compiler warnings (I've got too used to building with `--ghc-options -w`).
Diffstat (limited to '')
-rw-r--r--app/RemovePath.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/RemovePath.hs b/app/RemovePath.hs
index 23cabb7..7157100 100644
--- a/app/RemovePath.hs
+++ b/app/RemovePath.hs
@@ -19,7 +19,7 @@ import Utils.Prompt
import Utils.PromptMessage
data Options = Options
- { optName :: WindowsEnv.VarName
+ { optName :: WindowsEnv.Name
, optYes :: Bool
, optGlobal :: Bool
, optPaths :: [String]
@@ -69,8 +69,8 @@ removePath options = runExceptT doRemovePath >>= either ioError return
defaultValue = do
expandedPaths <- mapM WindowsEnv.expand pathsToRemove
if pathsToRemove == expandedPaths
- then return $ WindowsEnv.VarValue False ""
- else return $ WindowsEnv.VarValue True ""
+ then return $ WindowsEnv.Value False ""
+ else return $ WindowsEnv.Value True ""
doRemovePath = do
removePathFrom WindowsEnv.CurrentUser
@@ -82,7 +82,7 @@ removePath options = runExceptT doRemovePath >>= either ioError return
let oldPaths = WindowsEnv.pathSplit $ show oldValue
let newPaths = filter (flip notElem pathsToRemove) oldPaths
when (length oldPaths /= length newPaths) $ do
- let newValue = WindowsEnv.VarValue (WindowsEnv.varValueExpandable oldValue) (WindowsEnv.pathJoin newPaths)
+ let newValue = WindowsEnv.Value (WindowsEnv.valueExpandable oldValue) (WindowsEnv.pathJoin newPaths)
let promptAnd = if skipPrompt
then withoutPrompt
else withPrompt $ oldNewMessage profile varName oldValue newValue