diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-02-28 16:59:52 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-02-28 16:59:52 -0400 |
commit | a35208c5df555006431a66436288ce156af4fdb9 (patch) | |
tree | 5c07d4b504f56f7f1f58a9c186a0166be67b87d8 /Config | |
parent | 037834477ef6ac97f9a50e02a529a4f6d2fc7b45 (diff) |
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.
Diffstat (limited to 'Config')
-rw-r--r-- | Config/Files.hs | 7 |
1 files changed, 6 insertions, 1 deletions
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 |