|
@@ -275,10 +275,13 @@ pub fn notarize(
|
|
|
.output_ok()
|
|
|
.context("failed to upload app to Apple's notarization servers.")?;
|
|
|
|
|
|
- let mut stdout = std::str::from_utf8(&output.stdout)?.to_string();
|
|
|
- stdout.push('\n');
|
|
|
+ // combine both stdout and stderr to support macOS below 10.15
|
|
|
+ let mut notarize_response = std::str::from_utf8(&output.stdout)?.to_string();
|
|
|
+ notarize_response.push('\n');
|
|
|
+ notarize_response.push_str(std::str::from_utf8(&output.stderr)?);
|
|
|
+ notarize_response.push('\n');
|
|
|
if let Some(uuid) = Regex::new(r"\nRequestUUID = (.+?)\n")?
|
|
|
- .captures_iter(&stdout)
|
|
|
+ .captures_iter(¬arize_response)
|
|
|
.next()
|
|
|
{
|
|
|
info!("notarization started; waiting for Apple response...");
|
|
@@ -288,7 +291,11 @@ pub fn notarize(
|
|
|
staple_app(app_bundle_path.clone())?;
|
|
|
} else {
|
|
|
return Err(
|
|
|
- anyhow::anyhow!("failed to parse RequestUUID from upload output. {}", stdout).into(),
|
|
|
+ anyhow::anyhow!(
|
|
|
+ "failed to parse RequestUUID from upload output. {}",
|
|
|
+ notarize_response
|
|
|
+ )
|
|
|
+ .into(),
|
|
|
);
|
|
|
}
|
|
|
|
|
@@ -326,10 +333,13 @@ fn get_notarization_status(
|
|
|
.output_ok();
|
|
|
|
|
|
if let Ok(output) = result {
|
|
|
- let mut stdout = std::str::from_utf8(&output.stdout)?.to_string();
|
|
|
- stdout.push('\n');
|
|
|
+ // combine both stdout and stderr to support macOS below 10.15
|
|
|
+ let mut notarize_status = std::str::from_utf8(&output.stdout)?.to_string();
|
|
|
+ notarize_status.push('\n');
|
|
|
+ notarize_status.push_str(std::str::from_utf8(&output.stderr)?);
|
|
|
+ notarize_status.push('\n');
|
|
|
if let Some(status) = Regex::new(r"\n *Status: (.+?)\n")?
|
|
|
- .captures_iter(&stdout)
|
|
|
+ .captures_iter(¬arize_status)
|
|
|
.next()
|
|
|
{
|
|
|
let status = status[1].to_string();
|
|
@@ -339,7 +349,7 @@ fn get_notarization_status(
|
|
|
Err(
|
|
|
anyhow::anyhow!(format!(
|
|
|
"Apple failed to notarize your app. {}",
|
|
|
- std::str::from_utf8(&output.stdout)?
|
|
|
+ notarize_status
|
|
|
))
|
|
|
.into(),
|
|
|
)
|
|
@@ -347,8 +357,7 @@ fn get_notarization_status(
|
|
|
Err(
|
|
|
anyhow::anyhow!(format!(
|
|
|
"Unknown notarize status {}. {}",
|
|
|
- status,
|
|
|
- std::str::from_utf8(&output.stdout)?
|
|
|
+ status, notarize_status
|
|
|
))
|
|
|
.into(),
|
|
|
)
|