bazarr/check_update.py

12 lines
521 B
Python
Raw Normal View History

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