Skip to content

Instantly share code, notes, and snippets.

@jfoote
Created February 20, 2015 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfoote/7ba999e5dd1c757ccfc3 to your computer and use it in GitHub Desktop.
Save jfoote/7ba999e5dd1c757ccfc3 to your computer and use it in GitHub Desktop.
Run git-shadow on disk files
#!/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