Merge pull request #1216 from erikd/init-msg

yesod-bin: Improve the 'use stack' message
This commit is contained in:
Maximilian Tagher 2016-04-18 16:21:06 -07:00
commit f9bde33547

View File

@ -102,7 +102,7 @@ main = do
] optParser'
let cabal = rawSystem' (cabalCommand o)
case optCommand o of
Init _ -> error "The init command has been removed. Please use 'stack new' instead"
Init _ -> initErrorMsg
HsFiles -> mkHsFile
Configure -> cabal ["configure"]
Build es -> touch' >> cabal ("build":es)
@ -144,6 +144,17 @@ main = do
hPutStrLn stderr "Instead, please just run 'stack test'"
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 = do
env <- getEnvironment