diff --git a/packages/app-builder-lib/electron-osx-sign/util-provisioning-profiles.js b/packages/app-builder-lib/electron-osx-sign/util-provisioning-profiles.js index 1281dac4230..e7c104c0e5f 100644 --- a/packages/app-builder-lib/electron-osx-sign/util-provisioning-profiles.js +++ b/packages/app-builder-lib/electron-osx-sign/util-provisioning-profiles.js @@ -71,8 +71,13 @@ var getProvisioningProfileAsync = module.exports.getProvisioningProfileAsync = f return execFileAsync('security', securityArgs) .then(async function (result) { + // make filename unique so it doesn't create issues with parallel method calls + const timestamp = process.hrtime.bigint + ? process.hrtime.bigint().toString() + : process.hrtime().join('') + // todo read directly - const tempFile = path.join(os.tmpdir(), `${require('crypto').createHash('sha1').update(filePath).digest("hex")}.plist`) + const tempFile = path.join(os.tmpdir(), `${require('crypto').createHash('sha1').update(filePath).update(timestamp).digest('hex')}.plist`) await fs.outputFile(tempFile, result) const plistContent = await executeAppBuilderAsJson(["decode-plist", "-f", tempFile]) await fs.unlink(tempFile)