From 362afc225398c2064beb0740b876aa83ae4c4a74 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Tue, 10 Dec 2019 16:12:05 +0100 Subject: [PATCH] fix: [Update] force manual update, fix #443 --- bin/LAUNCH.sh | 4 ++-- bin/Update.py | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/LAUNCH.sh b/bin/LAUNCH.sh index 406c4a77..6970787e 100755 --- a/bin/LAUNCH.sh +++ b/bin/LAUNCH.sh @@ -445,7 +445,7 @@ function shutdown { function update() { bin_dir=${AIL_HOME}/bin - bash -c "python3 $bin_dir/Update.py" + bash -c "python3 $bin_dir/Update.py $1" exitStatus=$? if [ $exitStatus -ge 1 ]; then echo -e $RED"\t* Update Error"$DEFAULT @@ -576,7 +576,7 @@ while [ "$1" != "" ]; do ;; -m | --menu ) menu_display; ;; - -u | --update ) update; + -u | --update ) update "--manual"; ;; -t | --thirdpartyUpdate ) update_thirdparty; ;; diff --git a/bin/Update.py b/bin/Update.py index 9e02d571..250cc297 100755 --- a/bin/Update.py +++ b/bin/Update.py @@ -12,6 +12,7 @@ Update AIL clone and fork import configparser import os import sys +import argparse import subprocess @@ -342,7 +343,13 @@ if __name__ == "__main__": print('* Updating AIL ... *') print('******************************************************************{}'.format(TERMINAL_DEFAULT)) - if auto_update_enabled(cfg): + # manual updates + parser = argparse.ArgumentParser() + parser.add_argument("--manual", nargs='?', const=True, default=False) + args = parser.parse_args() + manual_update = args.manual + + if auto_update_enabled(cfg) or manual_update: if check_if_files_modified(): is_fork = repo_is_fork() if is_fork: