Use stack only if stack.yaml exists

This commit is contained in:
Bryan Richter 2015-07-22 16:45:36 -07:00
parent c6499bbe91
commit 7851a660a7
No known key found for this signature in database
GPG Key ID: B202264020068BFB

View File

@ -28,7 +28,7 @@ keter :: String -- ^ cabal command
-> Bool -- ^ no build?
-> Bool -- ^ no copy to?
-> IO ()
keter _cabal noBuild noCopyTo = do
keter cabal noBuild noCopyTo = do
ketercfg <- keterConfig
mvalue <- decodeFile ketercfg
value <-
@ -72,11 +72,12 @@ keter _cabal noBuild noCopyTo = do
collapse' (x:xs) = x : collapse' xs
collapse' [] = []
unless noBuild $ do
run "stack" ["clean"]
-- run cabal ["configure"]
createDirectoryIfMissing True "./dist/bin"
run "stack" $ words "--local-bin-path ./dist/bin build --copy-bins"
unless noBuild $ if elem "stack.yaml" files
then do run "stack" ["clean"]
createDirectoryIfMissing True "./dist/bin"
run "stack"
(words "--local-bin-path ./dist/bin build --copy-bins")
else mapM_ (\x -> run cabal [x]) ["clean", "configure", "build"]
_ <- try' $ removeDirectoryRecursive "static/tmp"