performance and code structure improvements

This commit is contained in:
2023-11-30 19:43:15 +01:00
parent d744144d6d
commit 6121ce5418
12 changed files with 47 additions and 92 deletions

View File

@@ -1,23 +1,28 @@
import os
import sys
yes = {'yes', 'y', 'ye', ''}
no = {'no', 'n'}
yes = {"yes", "y", "ye", ""}
no = {"no", "n"}
if len(sys.argv) > 1:
choice = sys.argv[1].removeprefix("-")
else:
sys.stdout.write(
"Do you want to open only the built project instead of the Godot Editor after building? ([y]es/[n]o): ")
"Do you want to open only the built project instead of the Godot Editor after building? ([y]es/[n]o): "
)
choice = input().lower()
if choice in yes:
os.system("python -m SCons && python -m SCons target=template_release && cd project && godot")
os.system(
"python -m SCons && python -m SCons target=template_release && cd project && godot"
)
elif choice in no:
if os.name == 'nt':
if os.name == "nt":
os.system(
"python -m SCons && python -m SCons target=template_release && godot project\project.godot")
"python -m SCons && python -m SCons target=template_release && godot project\project.godot"
)
else:
os.system(
"python -m SCons && python -m SCons target=template_release && godot project/project.godot")
"python -m SCons && python -m SCons target=template_release && godot project/project.godot"
)
else:
sys.stdout.write("Please respond with 'yes' or 'no'")