Improve behavior when a git-annex command is told to operate on a file that doesn't exist. It will now continue to other files specified after that on the command line, and only error out at the end.

This commit is contained in:
Joey Hess 2015-04-30 15:28:17 -04:00
parent 461b967966
commit efb37e7c78
5 changed files with 20 additions and 11 deletions

View file

@ -19,7 +19,7 @@ module Messages (
showEndOk,
showEndFail,
showEndResult,
showErr,
toplevelWarning,
warning,
warningIO,
indent,
@ -117,15 +117,16 @@ showEndResult ok = handleMessage (JSON.end ok) $ putStrLn msg
| ok = "ok"
| otherwise = "failed"
showErr :: (Show a) => a -> Annex ()
showErr e = warning' $ "git-annex: " ++ show e
toplevelWarning :: Bool -> String -> Annex ()
toplevelWarning makeway s = warning' makeway ("git-annex: " ++ s)
warning :: String -> Annex ()
warning = warning' . indent
warning = warning' True . indent
warning' :: String -> Annex ()
warning' w = do
handleMessage q $ putStr "\n"
warning' :: Bool -> String -> Annex ()
warning' makeway w = do
when makeway $
handleMessage q $ putStr "\n"
liftIO $ do
hFlush stdout
hPutStrLn stderr w