Skip to content

Instantly share code, notes, and snippets.

@mnebuerquo
Last active July 8, 2017 13:07
Show Gist options
  • Save mnebuerquo/3400501f72a7700af3aa926b45b0dbde to your computer and use it in GitHub Desktop.
Save mnebuerquo/3400501f72a7700af3aa926b45b0dbde to your computer and use it in GitHub Desktop.
Script to create a new Luminus project with my typical options
#!/bin/sh
# project name is first argument
PROJECTNAME=$1
shift
if [ -z "$PROJECTNAME" ]; then
echo "You gotta specify a name for your project, you big dummy!"
exit 1
fi
if [ -d "$PROJECTNAME" ] || [ -f "$PROJECTNAME" ]; then
echo "This project name is already a thing, you big dummy!"
exit 2
fi
set -e
# if we don't already have lein, download it
if [ ! -f "lein" ]; then
wget https://raw.github.com/technomancy/leiningen/stable/bin/lein
chmod +x lein
fi
# now create project
CMD="new luminus $PROJECTNAME +http-kit +re-frame +auth +swagger $@"
./lein $CMD
# project needs a copy of lein inside for deploying and so it doesn't need
# to be in a global bin directory
cp ./lein "$PROJECTNAME/"
# make this a git repo with an initial commit
cd "$PROJECTNAME"
# add a note for how the project was created
echo "\n\n"'## Project Created with Luminus'"\n\n"'`./lein '"$CMD "'`'>> README.md
git init
git add ./
git commit -m "Initial Commit of new Luminus project!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment