Last active
May 19, 2016 19:18
-
-
Save harryfinn/0c27eb26730c2d1ae3292e7fba1be75c to your computer and use it in GitHub Desktop.
bash script to pull down wp-with-brunch framework files
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 | |
function get_branch { | |
valid_branches=("theme" "component") | |
if `echo ${valid_branches[@]} | grep -qw "$1"`; then | |
echo "Branch selected: $1-framework" | |
git clone -b "$1-framework" [email protected]:1minus1limited/wp-with-brunch.git . | |
rm -rf .git .gitignore | |
else | |
echo "Invalid command" | |
fi | |
} | |
if [[ $1 == "cleanup" ]]; then | |
if [[ $(ls -A) ]]; then | |
rm -rf ..?* .[!.]* * | |
fi | |
else | |
get_branch $1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
WP With Brunch bash script
This bash script allows for simple inclusion of either the
theme-framework
orcomponent-framework
branches from thewp-with-brunch
repoSetup
Download this gist zip, extract it, grant it execution permissions and move it.
Usage
Simply enter a directory in which to create your theme or component (typically
the theme folder you are going to be working in) and run one of the following
commands:
wp-with-brunch theme
- For the theme frameworkwp-with-brunch component
- For the component frameworkwp-with-brunch cleanup
- To remove all files and folders should you wish to start over_Note:_ The
theme
andcomponent
commands can only be used in an emptyfolder so should be run at the start of your theme or component build.