factor out nukeFile

This commit is contained in:
Joey Hess 2012-06-06 13:13:13 -04:00
parent 723eb19bbf
commit 993e6459a3
5 changed files with 13 additions and 9 deletions

View file

@ -40,5 +40,5 @@ perform key = maybe droplocal dropremote =<< Remote.byName =<< from
performOther :: (Key -> Git.Repo -> FilePath) -> Key -> CommandPerform
performOther filespec key = do
f <- fromRepo $ filespec key
liftIO $ whenM (doesFileExist f) $ removeFile f
liftIO $ nukeFile f
next $ return True