From 508920bf728cfb5e4568b68a2943bd33efac26bc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 30 Apr 2015 15:28:17 -0400 Subject: 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. --- CmdLine/Action.hs | 2 +- CmdLine/Seek.hs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'CmdLine') diff --git a/CmdLine/Action.hs b/CmdLine/Action.hs index a32abbbee..b566621bb 100644 --- a/CmdLine/Action.hs +++ b/CmdLine/Action.hs @@ -43,7 +43,7 @@ commandAction a = account =<< tryIO go account (Right True) = return True account (Right False) = incerr account (Left err) = do - showErr err + toplevelWarning True (show err) showEndFail incerr incerr = do diff --git a/CmdLine/Seek.hs b/CmdLine/Seek.hs index 1db075ec3..96076261f 100644 --- a/CmdLine/Seek.hs +++ b/CmdLine/Seek.hs @@ -218,8 +218,9 @@ seekHelper a params = do ll <- inRepo $ \g -> concat <$> forM (segmentXargsOrdered params) (runSegmentPaths (\fs -> Git.Command.leaveZombie <$> a fs g)) forM_ (map fst $ filter (null . snd) $ zip params ll) $ \p -> - unlessM (isJust <$> liftIO (catchMaybeIO $ getSymbolicLinkStatus p)) $ - error $ p ++ " not found" + unlessM (isJust <$> liftIO (catchMaybeIO $ getSymbolicLinkStatus p)) $ do + toplevelWarning False (p ++ " not found") + Annex.incError return $ concat ll notSymlink :: FilePath -> IO Bool -- cgit v1.2.3