only perform checks when it needs to build
This commit is contained in:
parent
d87499deb5
commit
f576a8a435
@ -77,26 +77,27 @@ keter cabal noBuild noCopyTo buildArgs = do
|
|||||||
collapse' (x:xs) = x : collapse' xs
|
collapse' (x:xs) = x : collapse' xs
|
||||||
collapse' [] = []
|
collapse' [] = []
|
||||||
|
|
||||||
stackQueryRunSuccess <- do
|
unless noBuild $ do
|
||||||
(ec,_,_) <- readProcessWithExitCode "stack" ["query"] ""
|
stackQueryRunSuccess <- do
|
||||||
return (ec == ExitSuccess)
|
(ec,_,_) <- readProcessWithExitCode "stack" ["query"] ""
|
||||||
|
return (ec == ExitSuccess)
|
||||||
|
|
||||||
let inStackExec = isJust $ lookup "STACK_EXE" env'
|
let inStackExec = isJust $ lookup "STACK_EXE" env'
|
||||||
mStackYaml = lookup "STACK_YAML" env'
|
mStackYaml = lookup "STACK_YAML" env'
|
||||||
useStack = inStackExec || isJust mStackYaml || stackQueryRunSuccess
|
useStack = inStackExec || isJust mStackYaml || stackQueryRunSuccess
|
||||||
|
|
||||||
unless noBuild $ if useStack
|
if useStack
|
||||||
then do let stackYaml = maybeToList $ fmap ("--stack-yaml="<>) mStackYaml
|
then do let stackYaml = maybeToList $ fmap ("--stack-yaml="<>) mStackYaml
|
||||||
localBinPath = cwd' </> "dist/bin"
|
localBinPath = cwd' </> "dist/bin"
|
||||||
run "stack" $ stackYaml <> ["clean"]
|
run "stack" $ stackYaml <> ["clean"]
|
||||||
createDirectoryIfMissing True localBinPath
|
createDirectoryIfMissing True localBinPath
|
||||||
run "stack"
|
run "stack"
|
||||||
(stackYaml
|
(stackYaml
|
||||||
<> ["--local-bin-path",localBinPath,"build","--copy-bins"]
|
<> ["--local-bin-path",localBinPath,"build","--copy-bins"]
|
||||||
<> buildArgs)
|
<> buildArgs)
|
||||||
else do run cabal ["clean"]
|
else do run cabal ["clean"]
|
||||||
run cabal ["configure"]
|
run cabal ["configure"]
|
||||||
run cabal ("build" : buildArgs)
|
run cabal ("build" : buildArgs)
|
||||||
|
|
||||||
_ <- try' $ removeDirectoryRecursive "static/tmp"
|
_ <- try' $ removeDirectoryRecursive "static/tmp"
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user