Skip to content

Instantly share code, notes, and snippets.

@pibby
Created December 5, 2013 00:08
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 pibby/7797948 to your computer and use it in GitHub Desktop.
Save pibby/7797948 to your computer and use it in GitHub Desktop.
This bash script will ask for a Project Name and Directory name to create in Sites folder, clone my boilerplate repo, create a README with the project name and date this script was run, and open the directory in Sublime Text 2 (save as a project once opened)
#!/bin/bash
# Katie Harron - @pibby
# This bash script will ask for a Project Name and Directory name to create in Sites folder, clone my boilerplate repo, create a README with the project name and date this script was run, and open the directory in Sublime Text 2 (save as a project once opened)
echo "Project name: "
read name
echo "Project directory in ~/Sites: "
read directory
created=`date +%Y-%m-%d` # create date as Year-Month-Date
projectDirectory=~/Sites/$directory
# Create new project directory
mkdir -p "$projectDirectory"
# Clone Katie Harron's boilerplate template into new project directory
git clone git@github.com:pibby/boilerplate.git "$projectDirectory"
# Remove boilerplate readme and git files
rm -rf $projectDirectory/{.git*,README.md}
# Enter project directory
cd $projectDirectory
# Create new readme with Project name and current date
touch README.md
echo "$name
by Katie Harron - @pibby
$created
---
" > README.md
# That's all folks
echo "
Done and done. Get to coding!
"
echo "------------------------------------------"
echo "Don't forget to run npm install and grunt."
echo "------------------------------------------"
# Open directory in Sublime Text 2 so it can be saved as a project
/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl $projectDirectory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment