aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apps/RemovePath.hs
diff options
context:
space:
mode:
Diffstat (limited to '')
-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