Last active
August 29, 2015 14:24
-
-
Save jharmn/209b53f8342ec7c89e6d to your computer and use it in GitHub Desktop.
Find all subdirectories not initialized in git
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
from subprocess import check_output, CalledProcessError, STDOUT | |
from os import walk | |
for dir in walk('.').next()[1]: | |
try: | |
result = check_output('/usr/bin/git rev-parse --is-inside-work-tree', shell=True, stderr=STDOUT, cwd=dir) | |
except CalledProcessError: | |
print dir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment