fix: make packaging checks platform safe

This commit is contained in:
wuyouMaster
2026-09-20 18:16:41 +08:00
committed by Wxw-Gu
parent 4c25236070
commit b6d287a299
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -1 +1 @@
f1bbd88584075c0e6d3487357a06424949de26d7e6dcad803d210aab83b0cbda xkey_helper_4_1_13
a35d3fa67387e049cc30bc073f9e65b077aa1db9c5c2b183125dec695fa013b9 xkey_helper_4_1_13
+3 -3
View File
@@ -26,7 +26,6 @@ const {
validateSherpaRuntime,
validateSilkWasmRuntime,
findMacosHelperPaths,
isMacosCodeValid,
signMacosHelpers,
signMacosAppBundle
} = nodeRequire('../../scripts/after-pack.cjs') as {
@@ -36,7 +35,6 @@ const {
validateSherpaRuntime: (runtimeResources: string, platform: NodeJS.Platform, arch: string) => void
validateSilkWasmRuntime: (runtimeResources: string) => void
findMacosHelperPaths: (runtimeResources: string) => string[]
isMacosCodeValid: (targetPath: string, run?: CodesignRunner) => boolean
signMacosHelpers: (runtimeResources: string, run?: CodesignRunner) => string[]
signMacosAppBundle: (appBundlePath: string, run?: CodesignRunner) => string
}
@@ -276,7 +274,9 @@ describe('production runtime packaging', () => {
expect(stub.calls).toContainEqual(['--force', '--sign', '-', helperPath])
expect(stub.calls).toContainEqual(['--verify', '--strict', '--arch', 'arm64', helperPath])
expect(stub.calls).toContainEqual(['--verify', '--strict', '--arch', 'x86_64', helperPath])
expect(statSync(helperPath).mode & 0o777).toBe(0o755)
if (process.platform !== 'win32') {
expect(statSync(helperPath).mode & 0o777).toBe(0o755)
}
})
it('keeps helpers that already verify strictly without re-signing them', () => {