Add "assume yes" option to extraction script

Signed-off-by: William Brawner <me@wbrawner.com>
This commit is contained in:
William Brawner 2021-06-06 19:04:43 -06:00
parent 1690864689
commit cb17043e41

View file

@ -21,6 +21,7 @@ TODO: support case sensitive paths (Unix)
import glob
import os
import shutil
import sys
from reo_shared import *
@ -219,10 +220,15 @@ if not is_valid_extract_dir(extract_dir):
if not is_valid_extract_dir(extract_dir):
exit(1)
assume_yes = False
if len(sys.argv) > 1 and sys.argv[1] == '-y':
assume_yes = True
for step in steps:
if step[2] is None:
choice = input(step[1] + " ")
run = choice.lower()[0] == 'y'
if not assume_yes:
choice = input(step[1] + " ")
run = assume_yes or choice.lower()[0] == 'y'
else:
run = step[2]