Created
December 5, 2013 00:08
-
-
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)
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 | |
# 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 [email protected]: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