Skip to content

Commit

Permalink
fix 修复 wps-cn 应用在 -v 输出模式下”信息获取链接“输出错误的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ChengLuffy committed Oct 12, 2023
1 parent 6bc7164 commit 973d280
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/local/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::{fmt::Display, path::Path};
use crate::ALIAS;

pub mod config;
pub mod notification;
Expand Down Expand Up @@ -77,7 +78,13 @@ impl Display for CheckUpType {
bundle_id,
} => {
let dealed_app_name = app_name.to_lowercase().replace(' ', "-");
write!(f, "检查更新方式为 HomeBrew,获取到的 bundle_id 为: {bundle_id},默认的信息获取链接为: https://formulae.brew.sh/api/cask/{dealed_app_name}.json")
let alias_keys = ALIAS.keys();
let file_name = if !alias_keys.into_iter().any(|x| x == &bundle_id.to_string()) {
&dealed_app_name
} else {
&ALIAS[bundle_id]
};
write!(f, "检查更新方式为 HomeBrew,获取到的 bundle_id 为: {bundle_id},默认的信息获取链接为: https://formulae.brew.sh/api/cask/{file_name}.json")
}
}
}
Expand Down

0 comments on commit 973d280

Please sign in to comment.