add whenM and unlessM
Just more golfing.. I am pretty sure something in a library somewhere can do this, but I have been unable to find it.
This commit is contained in:
parent
75a3f5027f
commit
c91929f693
16 changed files with 60 additions and 63 deletions
|
@ -62,8 +62,8 @@ directorySetup u c = do
|
|||
-- verify configuration is sane
|
||||
let dir = maybe (error "Specify directory=") id $
|
||||
M.lookup "directory" c
|
||||
e <- liftIO $ doesDirectoryExist dir
|
||||
when (not e) $ error $ "Directory does not exist: " ++ dir
|
||||
liftIO $ doesDirectoryExist dir
|
||||
<|> error $ "Directory does not exist: " ++ dir
|
||||
c' <- encryptionSetup c
|
||||
|
||||
-- The directory is stored in git config, not in this remote's
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue