Complain about ynh_script_progression used with --time and --weight=1 all over the place

This commit is contained in:
Alexandre Aubin 2020-04-30 04:50:19 +02:00
parent 8a46b28747
commit e4f85ae967

View file

@ -874,6 +874,14 @@ class Script():
if self.contains("source _common.sh") or self.contains("source ./_common.sh"):
print_warning("In the context of backup and restore script, you should load _common.sh with \"source ../settings/scripts/_common.sh\"")
# Usage of ynh_script_prorgression with --time or --weight=1 all over the place...
if self.containsregex(r"ynh_script_progression.*--time"):
print_warning("Using ynh_script_progression --time should only be for calibrating the weight (c.f. --weight). It's not meant to be kept for production versions.")
if self.containsregex(r"ynh_script_progression.*--weight=1") and \
not self.containsregex(r"ynh_script_progression.*--weight=([^1]|[1-9]{2})"):
print_warning("Having only '--weight=1' for ynh_script_progression is useless... Either calibrate the weights with --time once, or don't put any --weight at all.")
def main():
if len(sys.argv) != 2: