From cd19471ea4aeafc1f808fc507e1dc84fc484929a Mon Sep 17 00:00:00 2001 From: Wendong-Fan Date: Thu, 20 Nov 2025 14:40:12 +0800 Subject: [PATCH] fix: update console info type for notarize env variable check --- config/notarize.cjs | 6 +++--- resources/scripts/download.js | 13 +++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/config/notarize.cjs b/config/notarize.cjs index e49639db0..673976b7d 100644 --- a/config/notarize.cjs +++ b/config/notarize.cjs @@ -11,9 +11,9 @@ exports.default = async function notarizing(context) { // Validate required environment variables if (!process.env.APPLE_ID || !process.env.APPLE_APP_SPECIFIC_PASSWORD || !process.env.APPLE_TEAM_ID) { - console.error("Missing required environment variables for notarization"); - console.error("Required: APPLE_ID, APPLE_APP_SPECIFIC_PASSWORD, APPLE_TEAM_ID"); - throw new Error("Notarization failed: Missing required environment variables"); + console.warn("Missing Apple environment variables for notarization"); + console.warn("Skipping notarization. Required: APPLE_ID, APPLE_APP_SPECIFIC_PASSWORD, APPLE_TEAM_ID"); + return; } return notarize({ diff --git a/resources/scripts/download.js b/resources/scripts/download.js index f77115815..0948791af 100644 --- a/resources/scripts/download.js +++ b/resources/scripts/download.js @@ -50,10 +50,15 @@ export async function downloadWithRedirects(url, destinationPath) { } // Check if file exists and has size > 0 - const stats = fs.statSync(destinationPath) - if (stats.size === 0) { - fs.unlinkSync(destinationPath) - reject(new Error('Downloaded file is empty')) + try { + const stats = fs.statSync(destinationPath) + if (stats.size === 0) { + fs.unlinkSync(destinationPath) + reject(new Error('Downloaded file is empty')) + return + } + } catch (statError) { + reject(new Error(`Failed to check downloaded file: ${statError.message}`)) return }