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.
This commit is contained in:
Joey Hess 2015-02-28 16:59:52 -04:00
parent ad1f4a7f1c
commit b9275b65f9
4 changed files with 17 additions and 20 deletions

View file

@ -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