aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2016-07-19 03:47:25 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2016-07-19 03:47:25 +0300
commit150cd57cb42acff553076f0bc3a231d291d174f4 (patch)
tree9e30e337fac3e97919aac23ef555cf89e8443ed1
parentrefactoring (diff)
downloadwindows-env-150cd57cb42acff553076f0bc3a231d291d174f4.tar.gz
windows-env-150cd57cb42acff553076f0bc3a231d291d174f4.zip
refactoring
-rw-r--r--apps/ListPath.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/ListPath.hs b/apps/ListPath.hs
index 03c0e68..086a219 100644
--- a/apps/ListPath.hs
+++ b/apps/ListPath.hs
@@ -40,8 +40,14 @@ listPath options = do
query = liftM (fromMaybe "") $ lookupEnv varName
+ prefix exists
+ | exists = "+ "
+ | otherwise = "- "
+
+ formatPath exists path = prefix exists ++ path
+
printPath path = do
exists <- doesDirectoryExist path
- putStrLn $ (if exists then "+" else "-") ++ " " ++ path
+ putStrLn $ formatPath exists path
printPaths = mapM_ printPath