Created
September 17, 2013 00:53
-
-
Save mstksg/6588764 to your computer and use it in GitHub Desktop.
Generate a Shakefile scaffold
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SHAKEFILE=${1:-"Shakefile"} | |
if [ ! -e "$SHAKEFILE" ]; then | |
tee -a "$SHAKEFILE" << 'EOF' > /dev/null | |
import Development.Shake | |
opts = shakeOptions { shakeFiles = ".shake/" | |
, shakeProgress = progressSimple } | |
(~>) = phony | |
main :: IO () | |
main = shakeArgs opts $ do | |
want [] | |
"clean" ~> removeFilesAfter ".shake" ["//*"] | |
-- phony "" $ do | |
-- need [] | |
-- "" *> \_ -> do | |
-- cmd "" [] | |
EOF | |
echo "Shakefile skeleton written to $SHAKEFILE" | |
fi |
(also, replacing #!/bin/bash
with #!/usr/bin/env bash
makes this script portable across FreeBSD installs)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
heads-up: adding
-- vim: filetype=haskell
as the first line in Shakefile lets vim set syntax highlighting without adding the.hs
extension