Fix ARTEMiS update script

This commit is contained in:
beerpsi 2024-03-23 03:04:43 +07:00
parent 3f5325f251
commit 64af827e7b
5 changed files with 38 additions and 15 deletions

View File

@ -17,21 +17,23 @@ for remote in repo.remotes:
continue
remote.fetch()
remote_master_id = repo.lookup_reference(f"refs/remotes/origin/{ARTEMIS_BRANCH}").target
remote_master_id = repo.lookup_reference(
f"refs/remotes/origin/{ARTEMIS_BRANCH}"
).target
merge_result, _ = repo.merge_analysis(remote_master_id)
if merge_result & pygit2.GIT_MERGE_ANALYSIS_UP_TO_DATE:
print("[INFO] ARTEMiS is up to date.")
elif merge_result & pygit2.GIT_MERGE_ANALYSIS_FASTFORWARD:
repo.checkout_tree(repo.get(remote_master_id))
master_ref = repo.lookup_reference(f"refs/heads/{ARTEMIS_BRANCH}")
master_ref.set_target(remote_master_id)
repo.head.set_target(remote_master_id)
elif merge_result & pygit2.GIT_MERGE_ANALYSIS_NORMAL:
print("[ERROR] You have local changes that leads to a conflict. good luck lmao.")
print(
"[ERROR] You have local changes that leads to a conflict. good luck lmao."
)
exit(1)

View File

@ -137,10 +137,11 @@ Copy-Item ../assets/aqua-importer.bat .
New-Item scripts -ItemType Directory
Copy-Item ../assets/start.ps1 scripts/
Copy-Item ../assets/database-tasks-wrapper.ps1 scripts/
Copy-Item ../assets/update-artemis.py scripts/
Copy-Item ../assets/aqua_importer_develop.py artemis/
curl.exe -L https://gitea.tendokyu.moe/Dniel97/AQUA-to-ARTEMiS/raw/branch/main/aqua_importer.py -o artemis/aqua_importer.py
$update_script = (Get-Content ../assets/update-artemis.ps1) -replace "%%ARTEMIS_REPO%%", "$artemis_repo" -replace "%%ARTEMIS_BRANCH%%", "$artemis_branch"
$update_script = (Get-Content ../assets/update-artemis.ps1) -replace "%%ARTEMIS_REPO%%", "https://gitea.tendokyu.moe/$artemis_repo.git" -replace "%%ARTEMIS_BRANCH%%", "$artemis_branch"
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
[System.IO.File]::WriteAllLines("scripts/update-artemis.ps1", $update_script, $Utf8NoBomEncoding)
@ -150,7 +151,7 @@ $aqua_importer = (Get-Content ../assets/aqua-importer.bat) -replace "%%ARTEMIS_B
$readme = (Get-Content ../assets/README.txt) -replace "%%MARIADB_ROOT_PASSWORD%%", "$mariadb_root_password" -replace "%%MARIADB_AIME_PASSWORD%%", "$mariadb_aime_password" -replace "%%MARIADB_PORT%%", "$mariadb_port"
$readme | Out-File -Force -FilePath README.txt
7z a -t7z ../artemis-portable.7z *
# 7z a -t7z ../artemis-portable.7z *
Set-Location ..
[System.Environment]::CurrentDirectory = (Get-Location).Path

View File

@ -6,7 +6,11 @@ with open(path, encoding="utf-8") as f:
errmsg = f.readlines()
errmsg[0] = "languages english=eng;\n"
errmsg = [line for line in errmsg if not line.startswith(" ") or line.startswith(" eng")]
errmsg = [
line
for line in errmsg
if not line.startswith(" ") or line.startswith(" eng")
]
with open(path, "w", encoding="utf-8") as f:
f.write("".join(errmsg))

View File

View File

@ -10,12 +10,28 @@ mariadb_port = int(sys.argv[3])
with open(core_config_path) as f:
config = yaml.safe_load(f)
config["server"]["listen_address"] = "0.0.0.0"
config["server"]["is_develop"] = False
config["server"]["threading"] = True
config["server"].update(
{
"listen_address": "0.0.0.0",
"is_develop": False,
"threading": True,
}
)
config["database"]["password"] = mariadb_password
config["database"]["port"] = mariadb_port
config["title"].update(
{
"reboot_start_time": "",
"reboot_end_time": "",
}
)
config["database"].update(
{
"password": mariadb_password,
"port": mariadb_port,
"enable_memcached": False,
}
)
config["aimedb"]["key"] = "Copyright(C)SEGA"