From 4196bb6bc8219c57290f641199c9e23b316ad777 Mon Sep 17 00:00:00 2001 From: David Allada Date: Tue, 11 Mar 2025 23:54:34 -0400 Subject: [PATCH] =?UTF-8?q?Update=20the=20behavior=20of=20start.py=20so=20?= =?UTF-8?q?that=20we=20can=20do=20a=20full=20build=20AND=20sa=E2=80=A6=20(?= =?UTF-8?q?#293)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update the behavior of start.py so that we can do a full build AND save the options, so we can build in a docker image * Add actual args RIP * Start: Move start_options write before dependency install message This ensures that start options are properly written before determining to exit. Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com> --------- Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com> Co-authored-by: kingbri <8082010+kingbri1@users.noreply.github.com> --- start.py | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/start.py b/start.py index 8fa46e6..619b07e 100644 --- a/start.py +++ b/start.py @@ -236,6 +236,20 @@ if __name__ == "__main__": subprocess.run(install_command) print() + if first_run: + start_options["first_run_done"] = True + + # Save start options on first run + with open("start_options.json", "w") as start_file: + start_file.write(json.dumps(start_options)) + + print( + "Successfully wrote your start script options to " + "`start_options.json`. \n" + "If something goes wrong, editing or deleting the file " + "will reinstall TabbyAPI as a first-time user." + ) + if args.update_deps: print( f"Dependencies updated. Please run TabbyAPI with `start.{script_ext}`. " @@ -248,21 +262,6 @@ if __name__ == "__main__": "inside the `update_scripts` folder." ) - # First run options - if first_run: - start_options["first_run_done"] = True - - # Save start options - with open("start_options.json", "w") as start_file: - start_file.write(json.dumps(start_options)) - - print( - "Successfully wrote your start script options to " - "`start_options.json`. \n" - "If something goes wrong, editing or deleting the file " - "will reinstall TabbyAPI as a first-time user." - ) - # Expand the parser if it's not fully created if not has_full_parser: from common.args import init_argparser