diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2017-06-11 05:56:10 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2017-06-11 05:56:10 +0300 |
commit | 837e60b9d8826168896ad4155ff7046f00665f52 (patch) | |
tree | 18c40efee9f38954079119587d3b60ababf5e555 /app/AddPath.hs | |
parent | delenv: ignore missing variables (diff) | |
download | windows-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/AddPath.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/AddPath.hs b/app/AddPath.hs index ff80b18..d141270 100644 --- a/app/AddPath.hs +++ b/app/AddPath.hs @@ -20,7 +20,7 @@ import Utils.Prompt import Utils.PromptMessage data Options = Options - { optName :: WindowsEnv.VarName + { optName :: WindowsEnv.Name , optYes :: Bool , optGlobal :: Bool , optPrepend :: Bool @@ -83,15 +83,15 @@ addPath options = runExceptT doAddPath >>= either ioError return defaultValue = do expandedPaths <- mapM WindowsEnv.expand pathsToAdd if pathsToAdd == expandedPaths - then return $ WindowsEnv.VarValue False "" - else return $ WindowsEnv.VarValue True "" + then return $ WindowsEnv.Value False "" + else return $ WindowsEnv.Value True "" doAddPath = do oldValue <- WindowsEnv.query profile varName `catchE` emptyIfMissing let oldPaths = WindowsEnv.pathSplit $ show oldValue let newPaths = pathsToAdd \\ oldPaths unless (null newPaths) $ do - let newValue = WindowsEnv.VarValue (WindowsEnv.varValueExpandable oldValue) $ WindowsEnv.pathJoin (mergePaths oldPaths newPaths) + let newValue = WindowsEnv.Value (WindowsEnv.valueExpandable oldValue) $ WindowsEnv.pathJoin (mergePaths oldPaths newPaths) promptAndEngrave oldValue newValue promptAndEngrave oldValue newValue = do |