fix(main): simplify argument handling for portable update helper
This commit is contained in:
1 parent
5f203b685e
commit
e77764be77
1 file changed
+11
-14
+11
-14
@@ -2253,21 +2253,18 @@ struct GithubAsset {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
#[cfg(any(windows, target_os = "linux", target_os = "macos"))]
|
||||
{
|
||||
let mut args = env::args_os();
|
||||
while let Some(argument) = args.next() {
|
||||
if argument == "--portable-update-helper" {
|
||||
let result = args
|
||||
.next()
|
||||
.map(PathBuf::from)
|
||||
.ok_or_else(|| "应用更新助手缺少描述文件".to_string())
|
||||
.and_then(|path| run_portable_update_helper(&path));
|
||||
if let Err(error) = result {
|
||||
eprintln!("{error}");
|
||||
}
|
||||
return;
|
||||
let mut args = env::args_os();
|
||||
while let Some(argument) = args.next() {
|
||||
if argument == "--portable-update-helper" {
|
||||
let result = args
|
||||
.next()
|
||||
.map(PathBuf::from)
|
||||
.ok_or_else(|| "应用更新助手缺少描述文件".to_string())
|
||||
.and_then(|path| run_portable_update_helper(&path));
|
||||
if let Err(error) = result {
|
||||
eprintln!("{error}");
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user