Skip to content

Commit

Permalink
Make output file path absolute
Browse files Browse the repository at this point in the history
Fixes an issue where the `run` command won't work if an output file is
also given (with `-o`).
  • Loading branch information
ollef committed Nov 9, 2017
1 parent 87c7788 commit aa3b6b8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Command/Compile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,15 @@ compile opts onError onSuccess = case maybe (Right Target.defaultTarget) Target.
withAssemblyDir (Just dir) k = do
createDirectoryIfMissing True dir
k dir

withOutputFile Nothing k
= withTempFile firstInputDir firstFileName $ \outputFile outputFileHandle -> do
hClose outputFileHandle
k outputFile
withOutputFile (Just o) k = do
o' <- makeAbsolute o
k o'

withOutputFile (Just o) k = k o
withLogHandle Nothing k = k stdout
withLogHandle (Just file) k = withFile file WriteMode k

Expand Down

0 comments on commit aa3b6b8

Please sign in to comment.