Update get_info.py

This commit is contained in:
shenjack 2023-01-06 21:48:56 +08:00
parent 7d1e2c5057
commit 7095aac89e

View File

@ -14,7 +14,9 @@ from Difficult_Rocket import DR_runtime
args = ['-env', '-github-dev'] args = ['-env', '-github-dev']
if sys.argv == '': # 没有输入参数,直接输出默认信息并输出 # print(sys.argv)
if sys.argv == [__file__]: # 没有输入参数,直接输出默认信息并输出
print(sys.version) print(sys.version)
from Difficult_Rocket.utils import tools from Difficult_Rocket.utils import tools
# 重置窗口信息 # 重置窗口信息
@ -23,14 +25,14 @@ if sys.argv == '': # 没有输入参数,直接输出默认信息并输出
config_file['window']['height'] = 768 config_file['window']['height'] = 768
rtoml.dump(config_file, open('./configs/main.toml', 'w')) rtoml.dump(config_file, open('./configs/main.toml', 'w'))
elif os.path.abspath(os.curdir) in sys.path and sys.argv == '-env': elif os.path.abspath(os.curdir) in sys.path and sys.argv[1] == '-env':
with open('./.github/workflows/env.ps1', encoding='utf-8', mode='w') as env_file: with open('./.github/workflows/env.ps1', encoding='utf-8', mode='w') as env_file:
print(f'$env:DR_version = "{DR_runtime.DR_version}"', file=env_file) print(f'$env:DR_version = "{DR_runtime.DR_version}"', file=env_file)
print(f'$env:DR_language = "{DR_runtime.language}"', file=env_file) print(f'$env:DR_language = "{DR_runtime.language}"', file=env_file)
print(f'$env:DR_long_version = "{DR_runtime.DR_long_version}"', file=env_file) print(f'$env:DR_long_version = "{DR_runtime.DR_long_version}"', file=env_file)
print(f'$env:Build_version = "{DR_runtime.Build_version}"', file=env_file) print(f'$env:Build_version = "{DR_runtime.Build_version}"', file=env_file)
elif os.path.abspath(os.curdir) in sys.path and sys.argv == '-github-env': elif os.path.abspath(os.curdir) in sys.path and sys.argv[1] == '-github-env':
print(f'DR_version={DR_runtime.DR_version}') print(f'DR_version={DR_runtime.DR_version}')
print(f'DR_language={DR_runtime.language}') print(f'DR_language={DR_runtime.language}')