Skip to content

Commit 4e7242a

Browse files
committed
Resolves purescript#1097. "Reading ..." error output is only shown when passed flag.
Uses the --verbose-errors flag to hide some "Reading ..." errors.
1 parent 918997a commit 4e7242a

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)