From 04944de4367fde059046c24dbbfef9a7bade2054 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Mon, 18 Apr 2016 14:25:10 +1000 Subject: [PATCH] yesod-bin: Improve the 'use stack' message Use `putStrLn` instead of `error` because ghc-8.0 prints call stack info for `error` calls. --- yesod-bin/main.hs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/yesod-bin/main.hs b/yesod-bin/main.hs index 07cca4e1..f81afff3 100755 --- a/yesod-bin/main.hs +++ b/yesod-bin/main.hs @@ -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