factor out a stopUnless
code melt for lunch
This commit is contained in:
parent
d64132a43a
commit
3f5f28b487
9 changed files with 69 additions and 107 deletions
|
@ -23,12 +23,9 @@ seek = [withFilesInGit $ whenAnnexed start]
|
|||
start :: FilePath -> (Key, Backend Annex) -> CommandStart
|
||||
start file (key, _) = do
|
||||
link <- calcGitLink file key
|
||||
l <- liftIO $ readSymbolicLink file
|
||||
if link == l
|
||||
then stop
|
||||
else do
|
||||
showStart "fix" file
|
||||
next $ perform file link
|
||||
stopUnless ((/=) link <$> liftIO (readSymbolicLink file)) $ do
|
||||
showStart "fix" file
|
||||
next $ perform file link
|
||||
|
||||
perform :: FilePath -> FilePath -> CommandPerform
|
||||
perform file link = do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue