yesod-bin: Improve the 'use stack' message
Use `putStrLn` instead of `error` because ghc-8.0 prints call stack info for `error` calls.
This commit is contained in:
parent
d19e3763ec
commit
04944de436
@ -102,7 +102,7 @@ main = do
|
|||||||
] optParser'
|
] optParser'
|
||||||
let cabal = rawSystem' (cabalCommand o)
|
let cabal = rawSystem' (cabalCommand o)
|
||||||
case optCommand o of
|
case optCommand o of
|
||||||
Init _ -> error "The init command has been removed. Please use 'stack new' instead"
|
Init _ -> initErrorMsg
|
||||||
HsFiles -> mkHsFile
|
HsFiles -> mkHsFile
|
||||||
Configure -> cabal ["configure"]
|
Configure -> cabal ["configure"]
|
||||||
Build es -> touch' >> cabal ("build":es)
|
Build es -> touch' >> cabal ("build":es)
|
||||||
@ -144,6 +144,17 @@ main = do
|
|||||||
hPutStrLn stderr "Instead, please just run 'stack test'"
|
hPutStrLn stderr "Instead, please just run 'stack test'"
|
||||||
exitFailure
|
exitFailure
|
||||||
|
|
||||||
|
initErrorMsg = do
|
||||||
|
mapM_ putStrLn
|
||||||
|
[ "The init command has been removed."
|
||||||
|
, "Please use 'stack new <project name> <template>' instead where the"
|
||||||
|
, "available templates can be found by running 'stack templates'. For"
|
||||||
|
, "a Yesod based application you should probably choose one of the"
|
||||||
|
, "pre-canned Yesod templates."
|
||||||
|
]
|
||||||
|
exitFailure
|
||||||
|
|
||||||
|
|
||||||
handleGhcPackagePath :: IO ([String], Maybe [(String, String)])
|
handleGhcPackagePath :: IO ([String], Maybe [(String, String)])
|
||||||
handleGhcPackagePath = do
|
handleGhcPackagePath = do
|
||||||
env <- getEnvironment
|
env <- getEnvironment
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user