From a35208c5df555006431a66436288ce156af4fdb9 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 28 Feb 2015 16:59:52 -0400 Subject: make programPath return FilePath not Maybe FilePath Looking at the few current callers, it's ok to have programPath throw an exception, in the unusual case where it cannot find git-annex. --- Config/Files.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Config') diff --git a/Config/Files.hs b/Config/Files.hs index b503a5443..d2b2f6a51 100644 --- a/Config/Files.hs +++ b/Config/Files.hs @@ -62,8 +62,13 @@ readProgramFile = do ( return p , ifM (inPath cmd) ( return cmd - , error $ "cannot find git-annex program in PATH or in the location listed in " ++ programfile + , cannotFindProgram ) ) where cmd = "git-annex" + +cannotFindProgram :: IO a +cannotFindProgram = do + f <- programFile + error $ "cannot find git-annex program in PATH or in the location listed in " ++ f -- cgit v1.2.3