2022-12-29 17:11:44 +08:00
|
|
|
# -------------------------------
|
|
|
|
# Difficult Rocket
|
2023-01-20 14:08:12 +08:00
|
|
|
# Copyright © 2020-2023 by shenjackyuanjie 3695888@qq.com
|
2022-12-29 17:11:44 +08:00
|
|
|
# All rights reserved
|
|
|
|
# -------------------------------
|
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
2023-01-01 10:58:10 +08:00
|
|
|
import rtoml
|
2022-12-29 17:11:44 +08:00
|
|
|
|
2022-12-29 17:30:04 +08:00
|
|
|
sys.path.append(os.path.abspath(os.curdir))
|
2023-01-03 15:34:06 +08:00
|
|
|
|
2023-01-06 21:29:13 +08:00
|
|
|
from Difficult_Rocket import DR_runtime
|
|
|
|
|
2023-01-06 21:36:06 +08:00
|
|
|
args = ['-env', '-github-dev']
|
2023-01-03 15:34:06 +08:00
|
|
|
|
2023-01-06 21:48:56 +08:00
|
|
|
# print(sys.argv)
|
|
|
|
|
2023-03-02 13:28:48 +08:00
|
|
|
|
|
|
|
|
2023-01-06 21:48:56 +08:00
|
|
|
if sys.argv == [__file__]: # 没有输入参数,直接输出默认信息并输出
|
2022-12-30 11:40:03 +08:00
|
|
|
print(sys.version)
|
2023-01-01 10:58:10 +08:00
|
|
|
from Difficult_Rocket.utils import tools
|
2023-01-02 17:22:39 +08:00
|
|
|
# 重置窗口信息
|
2023-01-01 10:58:10 +08:00
|
|
|
config_file = tools.load_file('./configs/main.toml')
|
|
|
|
config_file['window']['width'] = 1024
|
|
|
|
config_file['window']['height'] = 768
|
|
|
|
rtoml.dump(config_file, open('./configs/main.toml', 'w'))
|
2022-12-29 17:11:44 +08:00
|
|
|
|
2023-01-06 21:51:22 +08:00
|
|
|
elif os.path.abspath(os.curdir) in sys.path and '-env' in sys.argv:
|
2023-01-06 21:29:13 +08:00
|
|
|
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_language = "{DR_runtime.language}"', 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)
|
|
|
|
|
2023-01-06 21:51:22 +08:00
|
|
|
elif os.path.abspath(os.curdir) in sys.path and '-github' in sys.argv:
|
2022-12-30 10:59:44 +08:00
|
|
|
print(f'DR_version={DR_runtime.DR_version}')
|
2022-12-30 11:21:43 +08:00
|
|
|
print(f'DR_language={DR_runtime.language}')
|
2023-01-02 17:22:39 +08:00
|
|
|
print(f'DR_long_version={DR_runtime.DR_long_version}')
|
2023-01-03 15:34:06 +08:00
|
|
|
print(f'Build_version={DR_runtime.Build_version}')
|