simplified a bunch of Maybe handling
This commit is contained in:
parent
efa7f54405
commit
cad0e1c8b7
19 changed files with 81 additions and 140 deletions
|
@ -60,9 +60,8 @@ gen r u c = do
|
|||
directorySetup :: UUID -> RemoteConfig -> Annex RemoteConfig
|
||||
directorySetup u c = do
|
||||
-- verify configuration is sane
|
||||
let dir = case M.lookup "directory" c of
|
||||
Nothing -> error "Specify directory="
|
||||
Just d -> d
|
||||
let dir = maybe (error "Specify directory=") id $
|
||||
M.lookup "directory" c
|
||||
e <- liftIO $ doesDirectoryExist dir
|
||||
when (not e) $ error $ "Directory does not exist: " ++ dir
|
||||
c' <- encryptionSetup c
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue