Skip to content

Commit

Permalink
Extract file permissions mode for each file
Browse files Browse the repository at this point in the history
  • Loading branch information
davidanthoff committed Oct 26, 2024
1 parent 6e6b3e3 commit 2bd9793
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,11 +582,14 @@ pub fn install_from_url(

#[cfg(target_os = "macos")]
{
use std::os::unix::fs::PermissionsExt;

// TODO Add prompt that asks users to confirm this
eprintln!("Code signing");
for entry in walkdir::WalkDir::new(temp_dir.path()).into_iter().filter_map(|e| e.ok()) {
// TODO We also need to check for the correct permissions
if entry.metadata()?.is_file() {
// TODO Instead of comparing > 0 we need to change this to check for the right permissions on exectuable files and only
// sign those
if entry.metadata()?.is_file() && entry.metadata()?.permissions().mode() > 0 {
std::process::Command::new("codesign")
.arg("--sign")
.arg("-")
Expand Down

0 comments on commit 2bd9793

Please sign in to comment.