aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/app/RemovePath.hs
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2017-06-10 05:45:45 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2017-06-10 05:45:45 +0300
commit157523efff3c649f3ae8bc449fa84511e0463fc7 (patch)
treea627d67862cf54c9239c0a82302fc1330dae27dc /app/RemovePath.hs
parentaddpath: refactoring (diff)
downloadwindows-env-157523efff3c649f3ae8bc449fa84511e0463fc7.tar.gz
windows-env-157523efff3c649f3ae8bc449fa84511e0463fc7.zip
delpath: remove all directory path occurrences
Diffstat (limited to 'app/RemovePath.hs')
-rw-r--r--app/RemovePath.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/RemovePath.hs b/app/RemovePath.hs
index 6f2174b..bc2a076 100644
--- a/app/RemovePath.hs
+++ b/app/RemovePath.hs
@@ -9,7 +9,6 @@ module Main (main) where
import Control.Monad (void, when)
import Control.Monad.Trans.Except (catchE, runExceptT, throwE)
-import Data.List ((\\))
import System.IO.Error (ioError, isDoesNotExistError)
import Options.Applicative
@@ -75,7 +74,7 @@ removePath options = runExceptT doRemovePath >>= either ioError return
removePathFrom profile = do
oldValue <- WindowsEnv.query profile varName `catchE` emptyIfMissing
let oldPaths = WindowsEnv.pathSplit oldValue
- let newPaths = oldPaths \\ pathsToRemove
+ let newPaths = filter (flip notElem pathsToRemove) oldPaths
when (length oldPaths /= length newPaths) $ do
let newValue = WindowsEnv.pathJoin newPaths
let promptAnd = if skipPrompt