-
Notifications
You must be signed in to change notification settings - Fork 125
Open
Description
{-# LANGUAGE DeriveDataTypeable #-}
import Control.Exception ( Exception, throwIO )
import Data.Typeable ( Typeable )
import Development.Shake ( (%>), liftIO, shakeArgs, shakeOptions, want )
import System.Directory ( doesFileExist )
main = shakeArgs shakeOptions $ do
want ["a"]
"a" %> \_ -> do
liftIO $ create "a"
data FileExists = FileExists FilePath
deriving (Show, Typeable)
instance Exception FileExists
create :: FilePath -> IO ()
create name = do
exists <- doesFileExist name
if exists then
throwIO $ FileExists name
else
writeFile name ""$ ./build.hs
Error when running Shake build system:
* a
FileExists "a"
How can I tell Shake that the file already exists and it doesn't need to reset it?
Metadata
Metadata
Assignees
Labels
No labels