Created
December 15, 2014 19:33
-
-
Save erochest/585cd40409dff7d2c87f to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python3 | |
import shutil | |
import subprocess | |
def git_status(): | |
return subprocess.check_output( | |
['git', 'status', '--short'] | |
).decode().splitlines() | |
def main(): | |
for line in git_status().decode().splitlines(): | |
line = line[3:] | |
if line.startswith('../'): | |
line = line[3:] | |
print('{} => {}'.format(line, '/tmp')) | |
shutil.move(line, '/tmp/') | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment