Commit 05e72426 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Report an error if an executable is not found, unify paths.

parent 3178d829
......@@ -18,8 +18,10 @@ lookupInPathOracle :: Rules ()
lookupInPathOracle = do
answer <- newCache $ \query -> do
maybePath <- liftIO $ findExecutable query
let path = fromMaybe query maybePath
putOracle $ "Lookup executable '" ++ query ++ "': " ++ path
path <- case maybePath of
Just value -> return $ unifyPath value
Nothing -> putError $ "Cannot find executable '" ++ query ++ "'."
putOracle $ "Executable found: " ++ query ++ " => " ++ path
return path
_ <- addOracle $ \(LookupInPath query) -> answer query
return ()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment