Skip to content

Commit

Permalink
Removed linux "set_permissions" function becuase the zip extractor al…
Browse files Browse the repository at this point in the history
…ready does it
  • Loading branch information
EliteAsian123 committed Dec 17, 2023
1 parent 7412c02 commit 3901c3d
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,30 +201,6 @@ impl InnerState {
// Delete zip
let _ = remove_file(&zip_path);

// Change permissions (if on Linux)
self.set_permissions(version_id, profile)?;

Ok(())
}

#[cfg(not(target_os = "linux"))]
fn set_permissions(&self, _a: String, _b: String) -> Result<(), String> {
Ok(())
}

#[cfg(target_os = "linux")]
fn set_permissions(&self, version_id: String, profile: String) -> Result<(), String> {
use std::os::unix::prelude::PermissionsExt;

let exec = self.get_yarg_exec(version_id, profile)?;

let mut perms = fs::metadata(&exec)
.map_err(|e| format!("Failed to get permissions of file.\n{:?}", e))?
.permissions();
perms.set_mode(0o7111);
fs::set_permissions(&exec, perms)
.map_err(|e| format!("Failed to set permissions of file.\n{:?}", e))?;

Ok(())
}

Expand Down

0 comments on commit 3901c3d

Please sign in to comment.