Git All
This file contains 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
#!/usr/bin/env python2.7 | |
import sys, os | |
import subprocess, commands | |
def main(): | |
for folder in os.listdir("."): | |
if os.path.exists(os.path.join(folder, ".git")): | |
git = commands.getoutput('which git') | |
try: | |
print subprocess.check_output([git] + sys.argv[1:], cwd=os.path.abspath(folder)) | |
except subprocess.CalledProcessError, e: | |
print e.output | |
if __name__=="__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment