summaryrefslogtreecommitdiff
path: root/src/Propellor/Bootstrap.hs
diff options
context:
space:
mode:
authorJoey Hess2017-07-13 12:48:03 -0400
committerJoey Hess2017-07-13 12:48:03 -0400
commitbcc77819d0e6cb05225c55bf5b2473d4d97c0cbe (patch)
tree4eaf4e2b21aa718450eb8a85c4f227598103092f /src/Propellor/Bootstrap.hs
parentf16c8d2c80d3f940984f7e686be491bcf755616b (diff)
use stack build --dry-run to check if deps are installed
The system might have stack installed, so stack --version would succeed, but need stack setup to be run to get a working ghc. This will fail if stack is not installed, or if stack setup needs to be run. It does not fail when haskell libraries are not installed, but stack build will install those anyway, so that's ok.
Diffstat (limited to 'src/Propellor/Bootstrap.hs')
-rw-r--r--src/Propellor/Bootstrap.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Propellor/Bootstrap.hs b/src/Propellor/Bootstrap.hs
index baf36e49..d3d0264b 100644
--- a/src/Propellor/Bootstrap.hs
+++ b/src/Propellor/Bootstrap.hs
@@ -86,13 +86,12 @@ buildCommand bs = intercalate " && " (go (getBuilder bs))
, "ln -sf $(stack path --dist-dir)/build/propellor-config propellor"
]
--- Run cabal configure to check if all dependencies are installed;
--- if not, run the depsCommand.
+-- Check if all dependencies are installed; if not, run the depsCommand.
checkDepsCommand :: Bootstrapper -> Maybe System -> ShellCommand
checkDepsCommand bs sys = go (getBuilder bs)
where
go Cabal = "if ! cabal configure >/dev/null 2>&1; then " ++ depsCommand bs sys ++ "; fi"
- go Stack = "if ! stack --version >/dev/null 2>&1; then " ++ depsCommand bs sys ++ "; fi"
+ go Stack = "if ! stack build --dry-run >/dev/null 2>&1; then " ++ depsCommand bs sys ++ "; fi"
-- Install build dependencies of propellor, using the specified
-- Bootstrapper.