Skip to content

Commit 76940aa

Browse files
committed
Merge pull request purescript#1114 from mjgpy3/1097_less_verbose_compile_errors
Resolves purescript#1097. "Reading ..." error output is only shown when passed …
2 parents b186d90 + 4e7242a commit 76940aa

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

psc-make/Main.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ instance P.MonadMake Make where
6868
getTimestamp path = makeIO (const (P.SimpleErrorWrapper $ P.CannotGetFileInfo path)) $ do
6969
exists <- doesFileExist path
7070
traverse (const $ getModificationTime path) $ guard exists
71-
readTextFile path = makeIO (const (P.SimpleErrorWrapper $ P.CannotReadFile path)) $ do
72-
putStrLn $ "Reading " ++ path
73-
readFile path
71+
readTextFile path = do
72+
verboseErrorsEnabled <- asks P.optionsVerboseErrors
73+
makeIO (const (P.SimpleErrorWrapper $ P.CannotReadFile path)) $ do
74+
when verboseErrorsEnabled $ putStrLn $ "Reading " ++ path
75+
readFile path
7476
writeTextFile path text = makeIO (const (P.SimpleErrorWrapper $ P.CannotWriteFile path)) $ do
7577
mkdirp path
7678
putStrLn $ "Writing " ++ path

0 commit comments

Comments
 (0)