diff options
author | Joey Hess <joey@kitenet.net> | 2013-12-09 15:17:55 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-12-09 15:17:55 -0400 |
commit | 5d317483e788ee3bfd644b46d5ef16870129d168 (patch) | |
tree | 82f5081dff552bbd644f0d3560832bda6a5e002b | |
parent | 39b9df62c7a60efc95c0acd17cb0260dfdc6e9b5 (diff) |
detect parse failure where command is somehow empty (wtf?)
-rw-r--r-- | Build/EvilLinker.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Build/EvilLinker.hs b/Build/EvilLinker.hs index d26f9c2b7..8166d0e83 100644 --- a/Build/EvilLinker.hs +++ b/Build/EvilLinker.hs @@ -124,13 +124,15 @@ runParser' p s paramfile = either failedparse id (parse p "" s) failedparse e = error $ (show e) ++ "\n<<<\n" ++ s ++ "\n>>>" ++ - "\nparam file contained: <<<\n" ++ paramfile ++ "\n>>>" + "\nparam file contained: >>>\n" ++ paramfile ++ "\n<<<" atFile :: FilePath -> String atFile f = '@':f runAtFile :: Parser CmdParams -> String -> FilePath -> [String] -> IO (String, Bool) runAtFile p s f extraparams = do + when (null $ opts c) $ + error $ "failed to find any options for " ++ f ++ " in >>>" ++ s ++ "<<<" writeFile f (opts c) out <- getOutput (cmd c) (atFile f:extraparams) (env c) removeFile f |