Skip to content

Instantly share code, notes, and snippets.

@Paden
Last active Aug 29, 2015
Embed
What would you like to do?
NOESIS_WORKSPACE="/Users/paden/workspace/noesis"
#edit Hosts file
hosts()
{
subl /etc/hosts
}
#Go into your noesis workspace
ne()
{
cd ${NOESIS_WORKSPACE}
}
#pull down the latest and greatest from all repos
nePull()
{
find ${NOESIS_WORKSPACE} -type d -name .git \
| xargs -n 1 dirname \
| while read line; do echo $line && cd $line && git pull; done
}
#move over to new branch in all repos
#example: neBranch DEV20150102
neBranch()
{
find ${NOESIS_WORKSPACE} -type d -name .git \
| xargs -n 1 dirname \
| while read line; do echo $line && cd $line && git fetch && git checkout -b "$1" "origin/$1";
done;
}
#switch over to branch already on local machine
#example: neSwitch DEV20150102
neSwitch()
{
find ${NOESIS_WORKSPACE} -type d -name .git \
| xargs -n 1 dirname \
| while read line; do echo $line && cd $line && git fetch && git checkout "$1" && git pull; done;
}
#switch over to branch already on local machine PLUS
#drush drupal
#refresh npm modules and grunt on JS repos
#example: neSwitch DEV20150102
neSwitchHard()
{
cd ${NOESIS_WORKSPACE}/drupal
pwd
git fetch && git checkout "$1" && git pull
cd drupal
drush cc all
cd ${NOESIS_WORKSPACE}/ne-commonjs
pwd
git fetch && git checkout "$1" && git pull && rm -R node_modules/ && npm install && grunt
cd ${NOESIS_WORKSPACE}/ne-webServices
pwd
git fetch && git checkout "$1" && git pull && rm -R node_modules/ && npm install && grunt
cd ${NOESIS_WORKSPACE}/directives
pwd
git fetch && git checkout "$1" && git pull && rm -R node_modules/ && npm install && grunt
cd ${NOESIS_WORKSPACE}/ne-underwriting
pwd
git fetch && git checkout "$1" && git pull && rm -R node_modules/ && npm install && grunt
cd ${NOESIS_WORKSPACE}/bootstrap
pwd
git fetch && git checkout "$1" && git pull && rm -R node_modules/ && npm install && grunt
cd ${NOESIS_WORKSPACE}
}
#delete branch from all repos
#example: neDelete DEV20150102
neDelete()
{
find ${NOESIS_WORKSPACE} -type d -name .git \
| xargs -n 1 dirname \
| while read line; do echo $line && cd $line && git branch -D "$1"; done;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment