yesod build passes on exit code

This commit is contained in:
Michael Snoyman 2011-08-05 12:04:34 +03:00
parent 3c9b1da592
commit be69cbb14c

View File

@ -13,6 +13,7 @@ import qualified Data.Text.Lazy as LT
import qualified Data.Text.Lazy.Encoding as LT import qualified Data.Text.Lazy.Encoding as LT
import Control.Monad (unless) import Control.Monad (unless)
import System.Environment (getArgs) import System.Environment (getArgs)
import System.Exit (exitWith)
import Scaffold.Build (touch) import Scaffold.Build (touch)
import Scaffold.Devel (devel) import Scaffold.Devel (devel)
@ -44,14 +45,13 @@ main = do
_ -> (False, args') _ -> (False, args')
let cmd = if isDev then "cabal-dev" else "cabal" let cmd = if isDev then "cabal-dev" else "cabal"
let cabal rest = rawSystem cmd rest >> return () let cabal rest = rawSystem cmd rest >> return ()
let conf rest = cabal $ "configure":rest let build rest = rawSystem cmd $ "build":rest
let build rest = cabal $ "build":rest
case args of case args of
["init"] -> scaffold ["init"] -> scaffold
"build":rest -> touch >> build rest "build":rest -> touch >> build rest >>= exitWith
["touch"] -> touch ["touch"] -> touch
["devel"] -> devel cabal ["devel"] -> devel cabal
"configure":rest -> conf rest "configure":rest -> rawSystem cmd ("configure":rest) >>= exitWith
_ -> do _ -> do
putStrLn "Usage: yesod <command>" putStrLn "Usage: yesod <command>"
putStrLn "Available commands:" putStrLn "Available commands:"