aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apps/RemovePath.hs
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-07-12 17:10:29 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-07-12 17:10:29 +0300
commitc7d5766463e5e99fcd2352c7177cf057c1971615 (patch)
tree04e2c34217dd498111965a17b9cafcb633ed5c13 /apps/RemovePath.hs
parentminimize stack.yaml (diff)
downloadwindows-env-c7d5766463e5e99fcd2352c7177cf057c1971615.tar.gz
windows-env-c7d5766463e5e99fcd2352c7177cf057c1971615.zip
refactoring
Diffstat (limited to '')
-rw-r--r--apps/RemovePath.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/apps/RemovePath.hs b/apps/RemovePath.hs
index d85a7f4..e04a67b 100644
--- a/apps/RemovePath.hs
+++ b/apps/RemovePath.hs
@@ -42,14 +42,14 @@ main = execParser parser >>= removePath
removePath :: Options -> IO ()
removePath options = do
let varName = name options
- userVal <- Environment.queryFromRegistry Environment.CurrentUserEnvironment varName
- let userValParts = Environment.splitPaths userVal
+ userVal <- Environment.query Environment.CurrentUser varName
+ let userValParts = Environment.pathSplit userVal
let newUserValParts = filter (flip notElem $ paths options) userValParts
when (length userValParts /= length newUserValParts) $ do
- Environment.saveToRegistryWithPrompt Environment.CurrentUserEnvironment varName $ Environment.joinPaths newUserValParts
+ Environment.engraveWithPrompt Environment.CurrentUser varName $ Environment.pathJoin newUserValParts
when (global options) $ do
- globalVal <- Environment.queryFromRegistry Environment.AllUsersEnvironment varName
- let globalValParts = Environment.splitPaths globalVal
+ globalVal <- Environment.query Environment.AllUsers varName
+ let globalValParts = Environment.pathSplit globalVal
let newGlobalValParts = filter (flip notElem $ paths options) globalValParts
when (length globalValParts /= length newGlobalValParts) $ do
- Environment.saveToRegistryWithPrompt Environment.AllUsersEnvironment varName $ Environment.joinPaths newGlobalValParts
+ Environment.engraveWithPrompt Environment.AllUsers varName $ Environment.pathJoin newGlobalValParts