shakers 0.0.17 → 0.0.18
raw patch · 3 files changed
+10/−19 lines, 3 files
Files
- Shakefile.hs +2/−2
- shakers.cabal +1/−1
- src/Development/Shakers.hs +7/−16
Shakefile.hs view
@@ -36,8 +36,8 @@ -- | sanity -- fake "." pats "sanity" $ const $- need [ fakeFile "build-error", fakeFile "lint" ]+ need [ "build-error", "lint" ] -- | Default things to run. --- want [ fakeFile "sanity", fakeFile "format" ]+ want [ "sanity", "format" ]
shakers.cabal view
@@ -1,5 +1,5 @@ name: shakers-version: 0.0.17+version: 0.0.18 synopsis: Shake helpers. description: Primitive helpers for Shake files. homepage: https://github.com/swift-nav/shakers
src/Development/Shakers.hs view
@@ -40,7 +40,6 @@ , fake , meta , preprocess- , mirror , getHashedVersion , hsRules , stackRules@@ -306,21 +305,12 @@ preprocess :: FilePattern -> FilePath -> Action [(String, String)] -> Rules () preprocess target file macros = target %> \out -> do- need [ file ]+ alwaysRerun let f k v = "-D" <> k <> "=" <> v macros' <- macros content <- m4 $ file : (uncurry f <$> macros') writeFileChanged out content --- | Mirror files to the mirror directory.----mirror :: FilePath -> [FilePattern] -> Rules ()-mirror dir pats =- fake dir pats "mirror" $ mapM_ $ \file -> do- dir' <- mirrorDir- liftIO $ createDirectoryIfMissing True $ dropFileName (dir' </> file)- copyFileChanged file (dir' </> file)- -- | Build a hash version from a directory and file pattern. -- getHashedVersion :: FilePath -> [FilePattern] -> Action String@@ -501,13 +491,14 @@ dockerRules dir pats = do -- | mirror --- mirror dir pats-- -- | wipe- --- phony "wipe" $ do+ phony "mirror" $ do dir' <- mirrorDir liftIO $ removeFiles dir' [ "//*" ]+ files <- getDirectoryFiles dir pats+ forM_ files $ \file ->+ liftIO $ do+ createDirectoryIfMissing True $ dropFileName (dir' </> file)+ copyFile file (dir' </> file) -- | docker:login --