mirror of
https://github.com/tgbot-collection/ytdlbot.git
synced 2025-02-27 00:34:03 +08:00
we should use subprocess.call
because it'll return 0 or other exit code
This commit is contained in:
parent
5133bd6520
commit
f587c544a5
1 changed files with 5 additions and 5 deletions
|
@ -337,14 +337,14 @@ def hot_patch(*args):
|
|||
pull_unshallow = "git pull origin --unshallow"
|
||||
pull = "git pull"
|
||||
|
||||
subprocess.check_output(unset, shell=True, cwd=app_path)
|
||||
if subprocess.check_output(pull_unshallow, shell=True, cwd=app_path) != 0:
|
||||
subprocess.call(unset, shell=True, cwd=app_path)
|
||||
if subprocess.call(pull_unshallow, shell=True, cwd=app_path) != 0:
|
||||
logging.info("Already unshallow, pulling now...")
|
||||
subprocess.check_output(pull, shell=True, cwd=app_path)
|
||||
subprocess.call(pull, shell=True, cwd=app_path)
|
||||
|
||||
logging.info("Code is updated, applying hot patch now...")
|
||||
subprocess.check_output(apk_install, shell=True, cwd=app_path)
|
||||
subprocess.check_output(pip_install, shell=True, cwd=app_path)
|
||||
subprocess.call(apk_install, shell=True, cwd=app_path)
|
||||
subprocess.call(pip_install, shell=True, cwd=app_path)
|
||||
psutil.Process().kill()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue