mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-28 15:22:26 +03:00
Merge pull request #1830 from zed-industries/auto-update-filename
Make auto-update handle an app bundle name other than 'Zed.app'
This commit is contained in:
commit
9156d488ca
@ -218,11 +218,14 @@ impl AutoUpdater {
|
|||||||
let temp_dir = tempdir::TempDir::new("zed-auto-update")?;
|
let temp_dir = tempdir::TempDir::new("zed-auto-update")?;
|
||||||
let dmg_path = temp_dir.path().join("Zed.dmg");
|
let dmg_path = temp_dir.path().join("Zed.dmg");
|
||||||
let mount_path = temp_dir.path().join("Zed");
|
let mount_path = temp_dir.path().join("Zed");
|
||||||
let mut mounted_app_path: OsString = mount_path.join("Zed.app").into();
|
|
||||||
mounted_app_path.push("/");
|
|
||||||
let running_app_path = ZED_APP_PATH
|
let running_app_path = ZED_APP_PATH
|
||||||
.clone()
|
.clone()
|
||||||
.map_or_else(|| cx.platform().app_path(), Ok)?;
|
.map_or_else(|| cx.platform().app_path(), Ok)?;
|
||||||
|
let running_app_filename = running_app_path
|
||||||
|
.file_name()
|
||||||
|
.ok_or_else(|| anyhow!("invalid running app path"))?;
|
||||||
|
let mut mounted_app_path: OsString = mount_path.join(running_app_filename).into();
|
||||||
|
mounted_app_path.push("/");
|
||||||
|
|
||||||
let mut dmg_file = File::create(&dmg_path).await?;
|
let mut dmg_file = File::create(&dmg_path).await?;
|
||||||
let mut response = client.get(&release.url, Default::default(), true).await?;
|
let mut response = client.get(&release.url, Default::default(), true).await?;
|
||||||
|
Loading…
Reference in New Issue
Block a user