From 9a2c32a79e3a3795ca5da529440ccea50d87c4da Mon Sep 17 00:00:00 2001 From: DIYgod Date: Fri, 28 Mar 2025 14:54:07 +0800 Subject: [PATCH] chore: fix mas build --- apps/desktop/forge.config.cts | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/apps/desktop/forge.config.cts b/apps/desktop/forge.config.cts index dc5470026..64a146f02 100644 --- a/apps/desktop/forge.config.cts +++ b/apps/desktop/forge.config.cts @@ -283,19 +283,21 @@ const config: ForgeConfig = { }) yml.releaseDate = new Date().toISOString() - const ymlPath = path.join(basePath, ymlMapsMap[makeResults[0]?.platform!]) + if (makeResults[0]?.platform && ymlMapsMap[makeResults[0].platform] && basePath) { + const ymlPath = path.join(basePath, ymlMapsMap[makeResults[0].platform]) - const ymlStr = yaml.dump(yml, { - lineWidth: -1, - }) - fs.writeFileSync(ymlPath, ymlStr) + const ymlStr = yaml.dump(yml, { + lineWidth: -1, + }) + fs.writeFileSync(ymlPath, ymlStr) - makeResults.push({ - artifacts: [ymlPath], - platform: makeResults[0]!.platform, - arch: makeResults[0]!.arch, - packageJSON: makeResults[0]!.packageJSON, - }) + makeResults.push({ + artifacts: [ymlPath], + platform: makeResults[0]!.platform, + arch: makeResults[0]!.arch, + packageJSON: makeResults[0]!.packageJSON, + }) + } return makeResults },