Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Commit

Permalink
better error 2
Browse files Browse the repository at this point in the history
  • Loading branch information
mpickering committed Apr 5, 2019
1 parent 462b758 commit 4ecb198
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions hie-bios/src/HIE/Bios/Cradle.hs
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,12 @@ cabalAction work_dir mc _fp = do
++ [component_name | Just component_name <- [mc]]
(ex, args, stde) <-
withCurrentDirectory work_dir (readProcessWithExitCode "cabal" cab_args [])
let [dir, ghc_args] = lines args
final_args = map (fixImportDirs dir) (words ghc_args)
traceM dir
return (ex, stde, final_args)
case lines args of
[dir, ghc_args] -> do
let final_args = map (fixImportDirs dir) (words ghc_args)
traceM dir
return (ex, stde, final_args)
_ -> error (show (ex, args, stde))

fixImportDirs :: FilePath -> String -> String
fixImportDirs base_dir arg =
Expand Down

0 comments on commit 4ecb198

Please sign in to comment.