bazarr/check_update.py

12 lines
407 B
Python
Raw Normal View History

2017-10-28 10:18:16 +08:00
from get_general_settings import *
2017-11-07 12:53:31 +08:00
import os
2017-11-07 12:23:36 +08:00
import subprocess
2017-11-07 12:53:31 +08:00
2017-11-07 13:11:42 +08:00
def check_and_apply_update:
result = subprocess.check_output(["git", "pull", '--dry-run', 'origin', branch], stderr=subprocess.STDOUT).split('\n')
if result[2] is not '':
subprocess.check_output(["git", "pull", 'origin', branch])
os.execlp('python', 'python ' + os.path.join(os.path.dirname(__file__), 'bazarr.py'))