mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-09-19 05:54:20 +00:00
22 lines
613 B
Python
22 lines
613 B
Python
import os
|
|
import time
|
|
|
|
lastmod = []
|
|
dirToWatchList = []
|
|
path = './'
|
|
for dirpath in os.walk(path):
|
|
if '.git' in dirpath[0]:
|
|
continue
|
|
dirToWatch = dirpath[0]+'/'
|
|
lastmod.append(int(os.path.getmtime(dirToWatch)))
|
|
dirToWatchList.append(dirToWatch)
|
|
#lastmod = int(os.path.getmtime(dirToWatch))
|
|
|
|
while True:
|
|
for enum, dirToWatch in enumerate(dirToWatchList):
|
|
if lastmod[enum] != int(os.path.getmtime(dirToWatch)):
|
|
#print('Warning: Modify Detected.')
|
|
os.system('./git.sh')
|
|
lastmod[enum] = int(os.path.getmtime(dirToWatch))
|
|
time.sleep(1.0)
|