Skip to content

Instantly share code, notes, and snippets.

@matglas
Last active August 29, 2015 13:55
Show Gist options
  • Save matglas/8734874 to your computer and use it in GitHub Desktop.
Save matglas/8734874 to your computer and use it in GitHub Desktop.
Go to a kw directory
#!/bin/bash
#
# Include this script in your .bashrc like this:
# . ~/scripts/kwscripts
ROOT="/home/vhosts/"
function kws() {
project=$1
vhosts=$ROOT
cd "$vhosts$project/src"
}
function kwb() {
project=$1
vhosts=$ROOT
cd "$vhosts$project/build"
}
function kwp() {
project=$1
profile=$2
vhosts=$ROOT
if [ "$profile" == "" ]
then
cd "$vhosts$project/build/profiles/$project"
else
cd "$vhosts$project/build/profiles/$profile"
fi
}
function kwresetbranch() {
project=$1
branch=$2
vhosts=$ROOT
cd "$vhosts$project/src"
git checkout $branch
git pull
drush kw-b
cd "$vhosts$project/build"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment