diff --git a/.changes/pr246.md b/.changes/pr246.md new file mode 100644 index 00000000..ede581ec --- /dev/null +++ b/.changes/pr246.md @@ -0,0 +1,6 @@ +--- +"cargo-packager": "patch" +"@crabnebula/packager": "patch" +--- + +On macOS, fix notarization skipping needed environment variables when macos specific config has been specified in the config file. diff --git a/crates/packager/src/package/app/mod.rs b/crates/packager/src/package/app/mod.rs index 155d5ab5..7470fbd1 100644 --- a/crates/packager/src/package/app/mod.rs +++ b/crates/packager/src/package/app/mod.rs @@ -154,12 +154,9 @@ pub(crate) fn package(ctx: &Context) -> crate::Result> { // notarization is required for distribution match config .macos() - .map(|m| { - m.notarization_credentials - .clone() - .ok_or_else(|| crate::Error::MissingNotarizeAuthVars) - }) - .unwrap_or_else(codesign::notarize_auth) + .and_then(|m| m.notarization_credentials.clone()) + .ok_or(crate::Error::MissingNotarizeAuthVars) + .or_else(|_| codesign::notarize_auth()) { Ok(auth) => { tracing::debug!("Notarizing {}", app_bundle_path.display());