-
-
Save jfoote/7ba999e5dd1c757ccfc3 to your computer and use it in GitHub Desktop.
Run git-shadow on disk files
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 python | |
''' | |
0. Set Android Studio to auto-save files | |
1. Add all files to repo | |
2. git shadow activate | |
3. ./shadow_daemon.py & | |
Result is that modified files will be added to shadow repo a la vim | |
''' | |
import subprocess, os, time | |
if __name__ == "__main__": | |
while True: | |
fps = subprocess.check_output(["find", "android", "-type", "f"]).splitlines() | |
for fp in fps: | |
fp = os.path.abspath(fp) | |
try: | |
subprocess.check_output(["git", "shadow", "shadow-file", fp, fp]) | |
except Exception as e: | |
raise e | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment