Skip to content

Commit ff4d7b8

Browse files
fix: mis reading backup yml file
1 parent c1cdc18 commit ff4d7b8

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/celemod-ui/locales/en-US.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
"禁用全部": "Disable All",
129129
"启用全部": "Enable All",
130130
"应用修改": "Apply Changes",
131-
"主树隐藏依赖": "Hide Deps in Main Tree",
131+
"主树隐藏依赖": "Hide Deps",
132132
"检查可选依赖": "Check Optional Deps",
133133
"显示完整树": "Full Tree",
134134
"显示更新": "Show Updates",

src/main.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fn extract_mod_for_yaml(path: &PathBuf) -> anyhow::Result<serde_yaml::Value> {
5656
let mut archive = zip::ZipArchive::new(zipfile)?;
5757
let everest_name = archive
5858
.file_names()
59-
.find(|name| name.starts_with("everest.y"))
59+
.find(|name| name == "everest.yaml" || name == "everest.yml")
6060
.context("Failed to find everest.yaml")?
6161
.to_string();
6262

@@ -144,11 +144,13 @@ fn get_installed_mods_sync(mods_folder_path: String) -> Vec<LocalMod> {
144144
read_to_string_bom(&cache_path)?
145145
} else if entry.file_type().unwrap().is_dir() {
146146
let cache_path = entry.path().read_dir()?.find(|v| {
147-
v.as_ref().map(|v| v.file_name()
148-
.to_string_lossy()
149-
.to_string()
150-
.to_lowercase()
151-
.starts_with("everest.y"))
147+
v.as_ref().map(|v| {
148+
let name = v.file_name()
149+
.to_string_lossy()
150+
.to_string()
151+
.to_lowercase();
152+
name == "everest.yaml" || name == "everest.yml"
153+
})
152154
.unwrap_or(false)
153155
});
154156
match cache_path {

0 commit comments

Comments
 (0)