mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-07-24 17:20:51 +02:00
fix(updater): linux not retaining AppImage permissions, enhance tests (#1636)
* fix(updater): linux not retaining AppImage permissions, enhance tests - adds a test for migration from v1 to v2 - extends the existing integration test to actually verify if the app was updated * remove test framework * fix macos test * fix windows * wait on windows * fix wix * typo * fmt * install webkit2gtk-4.0 on ci * fix npm command on windows * fix test on windows * ubuntu-22.04 --------- Co-authored-by: Tillmann <28728469+tweidinger@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
e4e19e001b
commit
7701392500
@@ -784,6 +784,8 @@ impl Update {
|
||||
|
||||
let tmp_app_image = &tmp_dir.path().join("current_app.AppImage");
|
||||
|
||||
let permissions = std::fs::metadata(&self.extract_path)?.permissions();
|
||||
|
||||
// create a backup of our current app image
|
||||
std::fs::rename(&self.extract_path, tmp_app_image)?;
|
||||
|
||||
@@ -812,7 +814,9 @@ impl Update {
|
||||
return Err(Error::BinaryNotFoundInArchive);
|
||||
}
|
||||
|
||||
return match std::fs::write(&self.extract_path, bytes) {
|
||||
return match std::fs::write(&self.extract_path, bytes)
|
||||
.and_then(|_| std::fs::set_permissions(&self.extract_path, permissions))
|
||||
{
|
||||
Err(err) => {
|
||||
// if something went wrong during the extraction, we should restore previous app
|
||||
std::fs::rename(tmp_app_image, &self.extract_path)?;
|
||||
|
||||
Reference in New Issue
Block a user