Skip to content

Commit

Permalink
fix linux impl
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog-crabnebula committed Nov 19, 2023
1 parent 5cb46e7 commit 3cbed63
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/updater/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -671,20 +671,20 @@ impl Update {
];

for tmp_dir_location in tmp_dir_locations {
if let Some(tmp_dir) = tmp_dir_location() {
if let Some(tmp_dir_root) = tmp_dir_location() {
use std::os::unix::fs::{MetadataExt, PermissionsExt};

let (_, tmp_dir) = tempfile::Builder::new()
.prefix("current_app")
.tempdir_in(tmp_dir_root)?;
let tmp_dir_metadata = tmp_dir.metadata()?;

if extract_path_metadata.dev() == tmp_dir_metadata.dev() {
let mut perms = tmp_dir_metadata.permissions();
perms.set_mode(0o700);
std::fs::set_permissions(&tmp_dir, perms)?;

let (_, tmp_app_image) = tempfile::Builder::new()
.prefix("current_app")
.suffix(".AppImage")
.tempfile_in(tmp_dir)?
.keep()?;
let tmp_app_image = tmp_dir.path().join("current_app.AppImage");

// get metadata to restore later
let metadata = self.extract_path.metadata()?;
Expand Down

0 comments on commit 3cbed63

Please sign in to comment.