prepareAutogen skips its work if a cabal file does not exist.

This commit is contained in:
Kazu Yamamoto
2014-09-23 15:14:46 +09:00
parent 9ed4aa8fdf
commit 1545f05d87
2 changed files with 8 additions and 6 deletions

View File

@@ -21,15 +21,16 @@ import Control.Applicative ((<$>))
import Control.Concurrent (threadDelay)
import Control.Concurrent.Async (Async, async, wait)
import Control.Exception (Exception)
import Control.Monad (unless)
import Control.Monad (unless, when)
import CoreMonad (liftIO)
import Data.IORef (IORef, newIORef, readIORef, writeIORef)
import Data.List (isPrefixOf)
import Data.Maybe (isJust)
import Data.Time (UTCTime)
import Data.Typeable (Typeable)
import System.Directory (getModificationTime, doesDirectoryExist, getDirectoryContents)
import System.Process
import System.IO (openBinaryFile, IOMode(..))
import System.Process
import Language.Haskell.GhcMod
import Language.Haskell.GhcMod.Internal
@@ -168,8 +169,8 @@ watch n hdl = do
threadDelay 100000
watch (n - 1) hdl
prepareAutogen :: IO ()
prepareAutogen = do
prepareAutogen :: Cradle -> IO ()
prepareAutogen crdl = when (isJust $ cradleCabalFile crdl) $ do
prepared <- isAutogenPrepared
unless prepared $ do
hdl <- build