Skip to content

Commit

Permalink
fix: xattr on macos Sonoma 14.4.1 does not have -r option, bundle fai…
Browse files Browse the repository at this point in the history
…ling on Macos Sonoma 14.1.1
  • Loading branch information
olexiyb committed Apr 22, 2024
1 parent 535691a commit e76c22a
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tooling/bundler/src/bundle/macos/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// files into the `Contents` directory of the bundle.

use super::{
super::common::{self, CommandExt},
super::common,
icon::create_icns_file,
sign::{notarize, notarize_auth, sign, NotarizeAuthError, SignTarget},
};
Expand All @@ -37,6 +37,7 @@ use std::{
path::{Path, PathBuf},
process::Command,
};
use walkdir::WalkDir;

const NESTED_CODE_FOLDER: [&str; 6] = [
"MacOS",
Expand Down Expand Up @@ -139,11 +140,16 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
}

fn remove_extra_attr(app_bundle_path: &Path) -> crate::Result<()> {
Command::new("xattr")
.arg("-crs")
.arg(app_bundle_path)
.output_ok()
.context("failed to remove extra attributes from app bundle")?;
for entry in WalkDir::new(app_bundle_path).into_iter().filter_map(|e| e.ok()) {
let path = entry.path();
let mut command = Command::new("xattr");
command.arg("-c");
if entry.file_type().is_symlink() {
command.arg("-s");
}
command.arg(path);
command.output().with_context(|| format!("Failed to remove extra attributes from {path:?}"))?;
}
Ok(())
}

Expand Down

0 comments on commit e76c22a

Please sign in to comment.