improve error message when special remote program cannot be run

This commit is contained in:
Joey Hess 2015-11-18 12:30:01 -04:00
parent e88582ecad
commit a9a10ee0a9
Failed to extract signature
2 changed files with 19 additions and 6 deletions

View file

@ -369,12 +369,8 @@ startExternal :: ExternalType -> Annex ExternalState
startExternal externaltype = do
errrelayer <- mkStderrRelayer
liftIO $ do
(Just hin, Just hout, Just herr, pid) <- createProcess $
(proc cmd [])
{ std_in = CreatePipe
, std_out = CreatePipe
, std_err = CreatePipe
}
(Just hin, Just hout, Just herr, pid) <-
createProcess p `catchIO` runerr
fileEncoding hin
fileEncoding hout
fileEncoding herr
@ -390,6 +386,13 @@ startExternal externaltype = do
}
where
cmd = externalRemoteProgram externaltype
p = (proc cmd [])
{ std_in = CreatePipe
, std_out = CreatePipe
, std_err = CreatePipe
}
runerr _ = error ("Cannot run " ++ cmd ++ " -- Make sure it's in your PATH and is executable.")
checkearlytermination Nothing = noop
checkearlytermination (Just exitcode) = ifM (inPath cmd)

View file

@ -0,0 +1,10 @@
[[!comment format=mdwn
username="joey"
subject="""comment 6"""
date="2015-11-18T16:22:51Z"
content="""
@rob.syme I think that error message is pretty clear: git-annex-remote-ipfs
is not present in your PATH or perhaps is not executable.
(Still, the error message could be improved a bit, doing that now.)
"""]]