diff --git a/apps/desktop/electron/updater/checkout-legacy.test.ts b/apps/desktop/electron/updater/checkout-legacy.test.ts index 403ad3bc21..1dec0fbb4b 100644 --- a/apps/desktop/electron/updater/checkout-legacy.test.ts +++ b/apps/desktop/electron/updater/checkout-legacy.test.ts @@ -115,6 +115,7 @@ it.skipIf(process.platform !== 'win32')( hermesHome: home, channel: 'stable' as const } + await expect(readSourceUpdate(probe)).resolves.toMatchObject({ supported: true, channel: 'stable', behind: null }) await expect(readSourceUpdate({ ...probe, branch: 'main&echo INJECTED' })).rejects.toThrow( 'unsafe Windows command argument' diff --git a/apps/desktop/electron/updater/checkout-source.ts b/apps/desktop/electron/updater/checkout-source.ts index 0a0171cbdf..f571444160 100644 --- a/apps/desktop/electron/updater/checkout-source.ts +++ b/apps/desktop/electron/updater/checkout-source.ts @@ -46,6 +46,7 @@ export async function readSourceUpdate(probe: SourceUpdateProbe): Promise /["%&|<>^\r\n]/.test(value))) { throw new Error('The source check contains an unsafe Windows command argument.') } + const result: { stdout: string; stderr: string } = await execute( viaCmd ? (process.env.ComSpec ?? 'cmd.exe') : command, viaCmd