aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to '')
-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