shake.hs 513 Bytes
Newer Older
1 2
#! /usr/bin/env nix-shell
#! nix-shell -i runhaskell -A preCommit
3 4 5 6 7 8 9 10 11

import           Development.Shake
import           Development.Shake.FilePath
import           Control.Monad

main = shakeArgs shakeOptions $ do
  phony "clean" $ do
    removeFilesAfter "." ["README.md"]

12
  want ["README.md"]
13 14 15

  "README.md" %> \out -> do
    let template = ".README.md"
16
    need [template]
17 18 19
    (Stdout panpipe) <- cmd "which panpipe"
    cmd_ "pandoc --filter"
         [take (length panpipe - 1) panpipe, template, "-o", out]