more standard names for whenM and unlessM operators

These are defined in ifelse, but it's not currently available and I don't
want to pull in a library for 6 lines of code anyhow.

Also, ifelse sets the fixity to 1, which does not allow >>? error $ ...
This commit is contained in:
Joey Hess 2011-05-17 11:44:13 -04:00
parent c91929f693
commit 21d9c84e72
5 changed files with 13 additions and 13 deletions

View file

@ -75,7 +75,7 @@ bupSetup u c = do
-- bup init will create the repository.
-- (If the repository already exists, bup init again appears safe.)
showNote "bup init"
bup "init" buprepo [] <|> error "bup init failed"
bup "init" buprepo [] >>! error "bup init failed"
storeBupUUID u buprepo
@ -173,7 +173,7 @@ storeBupUUID u buprepo = do
showNote "storing uuid"
onBupRemote r boolSystem "git"
[Params $ "config annex.uuid " ++ u]
<|> error "ssh failed"
>>! error "ssh failed"
else liftIO $ do
r' <- Git.configRead r
let olduuid = Git.configGet r' "annex.uuid" ""

View file

@ -63,7 +63,7 @@ directorySetup u c = do
let dir = maybe (error "Specify directory=") id $
M.lookup "directory" c
liftIO $ doesDirectoryExist dir
<|> error $ "Directory does not exist: " ++ dir
>>! error $ "Directory does not exist: " ++ dir
c' <- encryptionSetup c
-- The directory is stored in git config, not in this remote's

View file

@ -169,7 +169,7 @@ withRsyncScratchDir a = do
return res
where
nuke d = liftIO $
doesDirectoryExist d <&> removeDirectoryRecursive d
doesDirectoryExist d >>? removeDirectoryRecursive d
rsyncRemote :: RsyncOpts -> [CommandParam] -> Annex Bool
rsyncRemote o params = do