Compare commits

...

3 Commits

Author SHA1 Message Date
beerpsi 267ac62b37 idk 2024-03-23 18:13:23 +07:00
beerpsi a9d174c374 Allow cloning ARTEMiS from other Git hosts 2024-03-23 18:13:23 +07:00
beerpsi 64af827e7b Fix ARTEMiS update script 2024-03-23 18:13:23 +07:00
4 changed files with 39 additions and 16 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

@ -1,5 +1,5 @@
$workdir = "work/"
$artemis_repo = "Hay1tsme/artemis" # must be hosted on gitea.tendokyu.moe
$artemis_repo = "https://gitea.tendokyu.moe/Hay1tsme/artemis.git"
$artemis_branch = "develop"
$python_version = "3.9.13"
$mariadb_mirror = "https://archive.mariadb.org" # can change to a nearby mirror for higher speed
@ -96,7 +96,7 @@ Set-Location ..
# Setting up ARTEMiS
# ----------------------------------------------------
Write-Output "[INFO] Downloading ARTEMiS..."
git.exe clone -b $artemis_branch "https://gitea.tendokyu.moe/$artemis_repo"
git.exe clone -b "$artemis_branch" "$artemis_repo"
Set-Location artemis
[System.Environment]::CurrentDirectory = (Get-Location).Path
@ -137,6 +137,7 @@ 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
@ -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

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