aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apps/RemovePath.hs
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2017-01-25 07:12:39 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2017-01-25 07:12:39 +0300
commit44a7cce93547336293745f3c750b046680195ffe (patch)
tree6c959ec6aff111c34f0fec92fa008a97c7bf4b1d /apps/RemovePath.hs
parentrename namespace 'Windows' to 'WindowsEnv' (diff)
downloadwindows-env-44a7cce93547336293745f3c750b046680195ffe.tar.gz
windows-env-44a7cce93547336293745f3c750b046680195ffe.zip
add a dummy module for re-exports
Diffstat (limited to 'apps/RemovePath.hs')
-rw-r--r--apps/RemovePath.hs18
1 files changed, 9 insertions, 9 deletions
diff --git a/apps/RemovePath.hs b/apps/RemovePath.hs
index 446b837..7d0c104 100644
--- a/apps/RemovePath.hs
+++ b/apps/RemovePath.hs
@@ -14,16 +14,16 @@ import System.IO.Error (ioError, isDoesNotExistError)
import Options.Applicative
-import qualified WindowsEnv.Environment as Env
+import qualified WindowsEnv
import Prompt
import PromptMessage
data Options = Options
- { optName :: Env.VarName
+ { optName :: WindowsEnv.VarName
, optYes :: Bool
, optGlobal :: Bool
- , optPaths :: [Env.VarValue]
+ , optPaths :: [WindowsEnv.VarValue]
} deriving (Eq, Show)
optionParser :: Parser Options
@@ -68,18 +68,18 @@ removePath options = runExceptT doRemovePath >>= either ioError return
| otherwise = throwE e
doRemovePath = do
- removePathFrom Env.CurrentUser
+ removePathFrom WindowsEnv.CurrentUser
when forAllUsers $
- removePathFrom Env.AllUsers
+ removePathFrom WindowsEnv.AllUsers
removePathFrom profile = do
- oldValue <- Env.query profile varName `catchE` emptyIfMissing
- let oldPaths = Env.pathSplit oldValue
+ oldValue <- WindowsEnv.query profile varName `catchE` emptyIfMissing
+ let oldPaths = WindowsEnv.pathSplit oldValue
let newPaths = oldPaths \\ pathsToRemove
when (length oldPaths /= length newPaths) $ do
- let newValue = Env.pathJoin newPaths
+ let newValue = WindowsEnv.pathJoin newPaths
let promptAnd = if skipPrompt
then withoutPrompt
else withPrompt $ oldNewMessage profile varName oldValue newValue
- let engrave = Env.engrave profile varName newValue
+ let engrave = WindowsEnv.engrave profile varName newValue
void $ promptAnd engrave