aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--apps/AddPath.hs6
-rw-r--r--apps/RemovePath.hs4
2 files changed, 6 insertions, 4 deletions
diff --git a/apps/AddPath.hs b/apps/AddPath.hs
index 9f9a5b1..a32244c 100644
--- a/apps/AddPath.hs
+++ b/apps/AddPath.hs
@@ -52,7 +52,7 @@ main = execParser parser >>= addPath
addPath :: Options -> IO ()
addPath options = do
- oldValue <- Env.query profile varName >>= emptyIfNotFound
+ oldValue <- Env.query profile varName >>= emptyIfMissing
let oldPaths = Env.pathSplit oldValue
let newPaths = oldPaths `union` pathsToAdd
when (length oldPaths /= length newPaths) $ do
@@ -73,7 +73,7 @@ addPath options = do
skipPrompt = optYes options
- emptyIfNotFound (Left e)
+ emptyIfMissing (Left e)
| isDoesNotExistError e = return ""
| otherwise = ioError e
- emptyIfNotFound (Right s) = return s
+ emptyIfMissing (Right s) = return s
diff --git a/apps/RemovePath.hs b/apps/RemovePath.hs
index 2956517..eb1cb00 100644
--- a/apps/RemovePath.hs
+++ b/apps/RemovePath.hs
@@ -63,7 +63,9 @@ removePath options = do
skipPrompt = optYes options
- removePathFrom profile = Env.query profile varName >>= either ignoreMissing (doRemovePathFrom profile)
+ removePathFrom profile = do
+ oldValue <- Env.query profile varName
+ either ignoreMissing (doRemovePathFrom profile) oldValue
ignoreMissing e
| isDoesNotExistError e = return ()