From 2fbc3ff8c7d0e29f08c3635e6502dc4aabb61892 Mon Sep 17 00:00:00 2001 From: LynithDev <61880709+LynithDev@users.noreply.github.com> Date: Mon, 16 Sep 2024 20:26:32 +0200 Subject: [PATCH] fix(workflow): Try catch updater keys --- packages/scripts/utils/patch.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/scripts/utils/patch.ts b/packages/scripts/utils/patch.ts index fb65dad9..68dca1de 100644 --- a/packages/scripts/utils/patch.ts +++ b/packages/scripts/utils/patch.ts @@ -1,4 +1,3 @@ -import type { CheckedEnvironment } from '.'; import fs from 'node:fs/promises'; import { type } from 'node:os'; import process from 'node:process'; @@ -6,6 +5,7 @@ import { consola } from 'consola'; import { execa } from 'execa'; import { join, resolve } from 'pathe'; import semver from 'semver'; +import type { CheckedEnvironment } from '.'; export async function tauriUpdateKey(env: CheckedEnvironment): Promise { if (process.env.TAURI_SIGNING_PRIVATE_KEY) @@ -78,10 +78,16 @@ export async function patchTauri(env: CheckedEnvironment, targets: string[], arg tauriPatch.build.features.push('devtools'); break; case 'build': - if (tauriConfig.bundle?.createUpdaterArtifacts !== false) { - const pubKey = await tauriUpdateKey(env); - if (pubKey != null) - tauriPatch.plugins.updater.pubkey = pubKey; + try { + if (tauriConfig.bundle?.createUpdaterArtifacts !== false) { + const pubKey = await tauriUpdateKey(env); + if (pubKey != null) + tauriPatch.plugins.updater.pubkey = pubKey; + } + } + catch (err) { + consola.error('failed to generate tauri updater keys'); + consola.error(err); } break; }