From 36669b811cb7a757687c14f3a97f6214c762e341 Mon Sep 17 00:00:00 2001 From: Dalton Date: Thu, 21 Mar 2024 22:33:16 -0400 Subject: [PATCH] Write commandline args --- modules/startup_checks.py | 20 ++++++++++++++++++++ skip_startup_checks.txt | 1 - 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/modules/startup_checks.py b/modules/startup_checks.py index 92ef0da5a..9538061ee 100644 --- a/modules/startup_checks.py +++ b/modules/startup_checks.py @@ -32,6 +32,26 @@ def vram_check(): else: return 3 +# Function to write new args to webui-user.bat file +def write_commandline_args(): + bat_file = "./webui-user.bat" + ## TODO: Switch this to use actual dynamic commandline args from user options and system info + new_commandline_args = "" + + # Read webui-user.bat file and save lines + with open(bat_file, 'r') as file: + lines = file.readlines() + + # Modify lines to have new commandline args + for i, line in enumerate(lines): + if line.strip().startswith('set COMMANDLINE_ARGS='): + lines[i] = f'set COMMANDLINE_ARGS={new_commandline_args}\n' + break + + # Write lines back to file + with open(bat_file, 'w') as file: + file.writelines(lines) + ## Main starting check sequence def start_check_sequence(): print("Running system checks") diff --git a/skip_startup_checks.txt b/skip_startup_checks.txt index 56a6051ca..e69de29bb 100644 --- a/skip_startup_checks.txt +++ b/skip_startup_checks.txt @@ -1 +0,0 @@ -1 \ No newline at end of file