Skip to content

Commit

Permalink
Stop nagging people that call stack test (fixes #845)
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Aug 25, 2015
1 parent bf21a7a commit 02a6b7f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Other enhancements:
* Set --enable-tests and --enable-benchmarks optimistically [#805](https://github.com/commercialhaskell/stack/issues/805)
* `--only-configure` option added [#820](https://github.com/commercialhaskell/stack/issues/820)
* Check for duplicate local package names
* Stop nagging people that call `stack test` [#845](https://github.com/commercialhaskell/stack/issues/845)

Bug fixes:

Expand Down
26 changes: 8 additions & 18 deletions src/main/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -165,27 +165,27 @@ main = withInterpreterArgs stackProgName $ \args isInterpreter -> do
globalOptsParser isTerminal)
(do addCommand "build"
"Build the project(s) in this directory/configuration"
(buildCmd Nothing)
buildCmd
(buildOptsParser Build)
addCommand "install"
"Shortcut for 'build --copy-bins'"
(buildCmd $ Just ("install", "copy-bins"))
buildCmd
(buildOptsParser Install)
addCommand "uninstall"
"DEPRECATED: This command performs no actions, and is present for documentation only"
uninstallCmd
(many $ strArgument $ metavar "IGNORED")
addCommand "test"
"Shortcut for 'build --test'"
(buildCmd $ Just ("test", "test"))
buildCmd
(buildOptsParser Test)
addCommand "bench"
"Shortcut for 'build --bench'"
(buildCmd $ Just ("bench", "bench"))
buildCmd
(buildOptsParser Bench)
addCommand "haddock"
"Shortcut for 'build --haddock'"
(buildCmd $ Just ("haddock", "haddock"))
buildCmd
(buildOptsParser Haddock)
addCommand "new"
"Create a new project from a template. Run `stack templates' to see available templates."
Expand Down Expand Up @@ -657,9 +657,8 @@ cleanCmd :: () -> GlobalOpts -> IO ()
cleanCmd () go = withBuildConfigAndLock go (\_ -> clean)

-- | Helper for build and install commands
buildCmd :: Maybe (Text, Text) -- ^ option synonym
-> BuildOpts -> GlobalOpts -> IO ()
buildCmd moptionSynonym opts go
buildCmd :: BuildOpts -> GlobalOpts -> IO ()
buildCmd opts go
| boptsFileWatch opts =
let getProjectRoot =
do (manager, lc) <- loadConfigWithOpts go
Expand All @@ -670,16 +669,7 @@ buildCmd moptionSynonym opts go
in fileWatch getProjectRoot inner
| otherwise = inner $ const $ return ()
where
inner setLocalFiles = withBuildConfigAndLock go $ \lk -> do
case moptionSynonym of
Nothing -> return ()
Just (cmd, opt) -> $logInfo $ T.concat
[ "NOTE: the "
, cmd
, " command is functionally equivalent to 'build --"
, opt
, "'"
]
inner setLocalFiles = withBuildConfigAndLock go $ \lk ->
globalFixCodePage go $ Stack.Build.build setLocalFiles (Just lk) opts

globalFixCodePage :: (Catch.MonadMask m, MonadIO m, MonadLogger m)
Expand Down

0 comments on commit 02a6b7f

Please sign in to comment.