shake.hs 686 Bytes
Newer Older
Valentin Reis's avatar
Valentin Reis committed
1
#! /usr/bin/env nix-shell
Valentin Reis's avatar
Valentin Reis committed
2
#! nix-shell ./default.nix -i runhaskell -A preCommit
Valentin Reis's avatar
Valentin Reis committed
3

4 5 6 7 8 9 10
{-|
Module      : shake.hs
Description : dev tasks
Copyright   : (c) Valentin Reis, 2018
License     : MIT
Maintainer  : fre@freux.fr -}

Valentin Reis's avatar
Valentin Reis committed
11 12 13 14 15 16 17 18 19 20 21 22
import           Development.Shake
import           Development.Shake.FilePath
import           Control.Monad

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

  want ["README.md"]

  "README.md" %> \out -> do
    let template = ".README.md"
Valentin Reis's avatar
Valentin Reis committed
23
    need [template , "src/Argonix.hs" ]
Valentin Reis's avatar
Valentin Reis committed
24 25 26 27
    (Stdout panpipe) <- cmd "which panpipe"
    cmd_ "pandoc --filter"
         [take (length panpipe - 1) panpipe, template, "-o", out]