Skip to content

Instantly share code, notes, and snippets.

@wozozo
Created October 8, 2012 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wozozo/3853338 to your computer and use it in GitHub Desktop.
Save wozozo/3853338 to your computer and use it in GitHub Desktop.
#!/bin/sh
set -e
usage() {
echo "Usage: `basename $0` [template repo] [project name]"
echo " e.g.: `basename $0` https://github.com/user/repo.git prjectname"
exit 1
}
REPO=$1
PROJ=$2
if [ -z "$REPO" ] || [ -z "$PROJ" ]; then
usage
fi
#TMPPRJ=/tmp/`cat /dev/urandom | tr -dc '[:alnum:]' | head -c 10`
TMPPRJ=/tmp/`echo \$RANDOM |md5sum |head -c 10`
git clone $REPO $TMPPRJ
django-admin.py startproject --template=$TMPPRJ $PROJ
rm -rf $TMPPRJ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment