aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apps/RemovePath.hs
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-07-18 00:43:21 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-07-18 00:43:21 +0300
commitbe9299d2dc8e0a9e76fe6f07cabb15c144999710 (patch)
tree91a68cd35e78c612eb358181f24e91fda904e766 /apps/RemovePath.hs
parentput modules to 'Windows' (diff)
downloadwindows-env-be9299d2dc8e0a9e76fe6f07cabb15c144999710.tar.gz
windows-env-be9299d2dc8e0a9e76fe6f07cabb15c144999710.zip
refactoring
Diffstat (limited to '')
-rw-r--r--apps/RemovePath.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/RemovePath.hs b/apps/RemovePath.hs
index ecc56c0..871ebef 100644
--- a/apps/RemovePath.hs
+++ b/apps/RemovePath.hs
@@ -13,7 +13,8 @@ import Data.Maybe (fromJust, isJust)
import Options.Applicative
import qualified Windows.Environment as Env
-import qualified Utils
+import Banner
+import Prompt
data Options = Options
{ optName :: Env.VarName
@@ -65,10 +66,10 @@ removePath options = do
let newPaths = oldPaths \\ pathsToRemove
when (length oldPaths /= length newPaths) $ do
let newValue = Env.pathJoin newPaths
- let promptBanner = Utils.engraveBanner profile varName oldValue newValue
- void $ prompt promptBanner $ Env.engrave profile varName newValue
+ let banner = engraveBanner profile varName oldValue newValue
+ void $ prompt banner $ Env.engrave profile varName newValue
skipPrompt = optYes options
- prompt = if skipPrompt
- then const Utils.withoutPrompt
- else Utils.withPrompt
+ prompt
+ | skipPrompt = const withoutPrompt
+ | otherwise = withPrompt