Skip to content

Instantly share code, notes, and snippets.

@dannyroberts
Last active December 12, 2015 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dannyroberts/4750437 to your computer and use it in GitHub Desktop.
Save dannyroberts/4750437 to your computer and use it in GitHub Desktop.
bash function to fetch the latest master on all submodules in parallel, wait until they're all updated, and then delete all pyc files
function delete-pyc() {
find . -name '*.pyc' -delete
}
function pull-latest-master() {
git checkout master; git pull &
git submodule foreach --recursive 'git checkout master; git pull &'
until [ -z "$(ps aux | grep '[g]it pull')" ]; do sleep 1; done
}
function update-code() {
pull-latest-master
delete-pyc
}
@dannyroberts
Copy link
Author

(I have these in my .bash_profile)

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