Last active
December 12, 2015 09:19
-
-
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
This file contains hidden or 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
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(I have these in my .bash_profile)