WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 85cb68c

Browse files
committed
Merge pull request #1830 from zed-industries/auto-update-filename
Make auto-update handle an app bundle name other than 'Zed.app'
1 parent 7aec6b5 commit 85cb68c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

crates/auto_update/src/auto_update.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,14 @@ impl AutoUpdater {
218218
let temp_dir = tempdir::TempDir::new("zed-auto-update")?;
219219
let dmg_path = temp_dir.path().join("Zed.dmg");
220220
let mount_path = temp_dir.path().join("Zed");
221-
let mut mounted_app_path: OsString = mount_path.join("Zed.app").into();
222-
mounted_app_path.push("/");
223221
let running_app_path = ZED_APP_PATH
224222
.clone()
225223
.map_or_else(|| cx.platform().app_path(), Ok)?;
224+
let running_app_filename = running_app_path
225+
.file_name()
226+
.ok_or_else(|| anyhow!("invalid running app path"))?;
227+
let mut mounted_app_path: OsString = mount_path.join(running_app_filename).into();
228+
mounted_app_path.push("/");
226229

227230
let mut dmg_file = File::create(&dmg_path).await?;
228231
let mut response = client.get(&release.url, Default::default(), true).await?;

0 commit comments

Comments
 (0)