Skip to content

Instantly share code, notes, and snippets.

@mstksg
Created September 17, 2013 00:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mstksg/6588764 to your computer and use it in GitHub Desktop.
Save mstksg/6588764 to your computer and use it in GitHub Desktop.
Generate a Shakefile scaffold
#!/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
@stites
Copy link

stites commented Nov 15, 2017

heads-up: adding -- vim: filetype=haskell as the first line in Shakefile lets vim set syntax highlighting without adding the .hs extension

@stites
Copy link

stites commented Nov 15, 2017

(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