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