Update the behavior of start.py so that we can do a full build AND sa… (#293)

* 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>
This commit is contained in:
David Allada 2025-03-11 23:54:34 -04:00 committed by GitHub
parent 73688670a6
commit 4196bb6bc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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