Skip to content

Instantly share code, notes, and snippets.

@harryfinn
Last active May 19, 2016 19:18
Show Gist options
  • Save harryfinn/0c27eb26730c2d1ae3292e7fba1be75c to your computer and use it in GitHub Desktop.
Save harryfinn/0c27eb26730c2d1ae3292e7fba1be75c to your computer and use it in GitHub Desktop.
bash script to pull down wp-with-brunch framework files
#/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" git@github.com: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
@harryfinn
Copy link
Author

harryfinn commented May 19, 2016

WP With Brunch bash script

This bash script allows for simple inclusion of either the theme-framework or
component-framework branches from the wp-with-brunch repo

Setup

Download this gist zip, extract it, grant it execution permissions and move it.

curl -O -L https://gist.github.com/harryfinn/0c27eb26730c2d1ae3292e7fba1be75c/archive/master.zip
unzip -j master.zip
rm master.zip
chmod +x wp_with_brunch.sh
mv wp_with_brunch.sh /usr/local/bin/wp-with-brunch

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 framework
  • wp-with-brunch component - For the component framework
  • wp-with-brunch cleanup - To remove all files and folders should you wish to start over

_Note:_ The theme and component commands can only be used in an empty
folder so should be run at the start of your theme or component build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment