git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Resolves #1097. "Reading ..." error output is only shown when passed flag.

Uses the --verbose-errors flag to hide some "Reading ..." errors.

commit4e7242a8fdf1c0d0052cb45a35f60dd4a916b1cd authorMichael Gilliland <mjg.py3@gmail.com> dateSat 9 May 2015, 16:11 (11 years ago) parent918997a
1 file changed+5−3
psc-make/Main.hs+5−3
psc-make/Main.hs+5−3
@@ -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