From 157523efff3c649f3ae8bc449fa84511e0463fc7 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 10 Jun 2017 05:45:45 +0300 Subject: delpath: remove all directory path occurrences --- app/RemovePath.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'app') 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 -- cgit v1.2.3