Browse Source

Minor fix

master
Michael Snoyman 9 years ago
parent
commit
627cebbcfa
  1. 7
      Shared.hs
  2. 2
      build.hs
  3. 2
      make-template.hs

7
Shared.hs

@ -16,15 +16,16 @@ master = "postgres"
-- | Works in the current Shelly directory. Confusingly, the @FilePath@
-- destination is relative to the original working directory.
createHsFiles :: LText -- ^ branch
createHsFiles :: FilePath -- ^ root
-> LText -- ^ branch
-> FilePath -- ^ destination
-> Sh ()
createHsFiles branch fp = do
createHsFiles root branch fp = do
files <- run "git" ["ls-tree", "-r", branch, "--name-only"]
liftIO $ createTree $ directory fp
liftIO
$ runResourceT
$ mapM_ (yield . toPair "yesod-scaffold" . fromText) (lines files)
$ mapM_ (yield . toPair root . fromText) (lines files)
$$ createTemplate
=$ writeFile fp
where

2
build.hs

@ -18,4 +18,4 @@ main = shellyNoDir $ do
run_ "cabal" ["install", "--only-dependencies"]
run_ "yesod" ["test"]
run_ "git" ["clean", "-fxd"]
createHsFiles branch $ "hsfiles" </> fromText branch <.> "hsfiles"
createHsFiles "yesod-scaffold" branch $ "hsfiles" </> fromText branch <.> "hsfiles"

2
make-template.hs

@ -16,4 +16,4 @@ main = do
_ -> error "Usage: make-template <repo location> <destination file>"
shellyNoDir $ do
cd root
createHsFiles "HEAD" dest
createHsFiles root "HEAD" dest

Loading…
Cancel
Save