From 7851a660a743393d6f28877bed14578d121cea95 Mon Sep 17 00:00:00 2001 From: Bryan Richter Date: Wed, 22 Jul 2015 16:45:36 -0700 Subject: [PATCH] Use stack only if stack.yaml exists --- yesod-bin/Keter.hs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/yesod-bin/Keter.hs b/yesod-bin/Keter.hs index fcc792de..69bfaeac 100644 --- a/yesod-bin/Keter.hs +++ b/yesod-bin/Keter.hs @@ -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"