Skip to content

Commit d5df1cb

Browse files
committed
fix: restrict self-update asset format by platform
1 parent 9ca0bc7 commit d5df1cb

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/command/oneself.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ impl Run for Oneself {
4949
let status = Update::configure()
5050
.repo_owner("thinkgos")
5151
.repo_name("goup-rs")
52+
.identifier(self_update_asset_identifier())
5253
.bin_name(cmd.get_name())
5354
.show_download_progress(true)
5455
.no_confirm(true)
@@ -80,6 +81,17 @@ impl Run for Oneself {
8081
}
8182
}
8283

84+
fn self_update_asset_identifier() -> &'static str {
85+
#[cfg(windows)]
86+
{
87+
".zip"
88+
}
89+
#[cfg(not(windows))]
90+
{
91+
".tar.gz"
92+
}
93+
}
94+
8395
fn remove_goup_exe() -> Result<(), anyhow::Error> {
8496
let exe = env::args().next().ok_or(anyhow!("Get exe path Failed"))?;
8597
let exe = Path::new(&exe);

0 commit comments

Comments
 (0)