Created
August 26, 2018 23:51
-
-
Save bigos/9794fbe50c96f13b1ad45fe6f609763f to your computer and use it in GitHub Desktop.
problem with nesting if statements in haskell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
check_if_proceed configFolders = do | |
let emacsdf = "/home/jacek/.emacs.d" | |
traceM ("calling check_if_proceed " ++ show ("ccc",configFolders)) | |
exists <- doesDirectoryExist emacsdf | |
symlink <- pathIsSymbolicLink emacsdf | |
let confemp = configFolders == [] | |
let result = False | |
if exists | |
then do | |
{ | |
if symlink | |
then do | |
{ | |
putStrLn ("This action will overwrite the existing symlink\n"++ | |
"poinitng to " ++ "SOMEWHERE-FINISH ME\n\n" ) | |
} | |
else do | |
{ | |
putStrLn (emacsdf ++ " is not a symlink\n"++ | |
"to use this utility, in your terminal do soemthing like:\n"++ | |
"$ mv " ++ emacsdf ++ " " ++ emacsdf ++ "-alternative-config\n" ++ | |
"exiting..." ) | |
} | |
} | |
else do | |
{ | |
putStrLn ("no " ++ emacsdf ++ "found in your home folder") | |
if confemp | |
then do | |
{ | |
putStrLn ("nor folders with the alternative emacs config\n" ++ | |
"exiting..." ) | |
} | |
else | |
do { | |
putStrLn "will try to symlink one of the found folders" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment