Disable yesod test for Stack (fixes #1198)

This commit is contained in:
Michael Snoyman 2016-03-28 20:26:42 +03:00
parent 8ce201faca
commit 814ad379b6
3 changed files with 19 additions and 6 deletions

View File

@ -1,3 +1,7 @@
## 1.4.18
* Disable `yesod test` when using Stack [#1198](https://github.com/yesodweb/yesod/issues/1198)
## 1.4.17
* Fully remove the `yesod init` command

View File

@ -6,7 +6,7 @@ import Data.Monoid
import Data.Version (showVersion)
import Options.Applicative
import System.Environment (getEnvironment)
import System.Exit (ExitCode (ExitSuccess), exitWith)
import System.Exit (ExitCode (ExitSuccess), exitWith, exitFailure)
import System.FilePath (splitSearchPath)
import System.Process (rawSystem)
@ -15,6 +15,7 @@ import Devel (DevelOpts (..), devel, DevelTermOpt(..)
import Keter (keter)
import Options (injectDefaults)
import qualified Paths_yesod_bin
import System.IO (hPutStrLn, stderr)
import HsFile (mkHsFile)
#ifndef WINDOWS
@ -130,10 +131,18 @@ main = do
}
devel develOpts develExtraArgs
where
cabalTest cabal = do touch'
_ <- cabal ["configure", "--enable-tests", "-flibrary-only"]
_ <- cabal ["build"]
cabal ["test"]
cabalTest cabal = do
env <- getEnvironment
case lookup "STACK_EXE" env of
Nothing -> do
touch'
_ <- cabal ["configure", "--enable-tests", "-flibrary-only"]
_ <- cabal ["build"]
cabal ["test"]
Just _ -> do
hPutStrLn stderr "'yesod test' is no longer needed with Stack"
hPutStrLn stderr "Instead, please just run 'stack test'"
exitFailure
handleGhcPackagePath :: IO ([String], Maybe [(String, String)])
handleGhcPackagePath = do

View File

@ -1,5 +1,5 @@
name: yesod-bin
version: 1.4.17.1
version: 1.4.18
license: MIT
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>