From 7cc953d87d134b93de1a46c46fd51dfa41439356 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Mon, 21 Feb 2022 15:39:34 +0800 Subject: [PATCH] fix upload script --- script/xcrun-wrapper.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/xcrun-wrapper.mjs b/script/xcrun-wrapper.mjs index d9a54a45..c128ac19 100644 --- a/script/xcrun-wrapper.mjs +++ b/script/xcrun-wrapper.mjs @@ -1,4 +1,5 @@ import execa from 'execa'; +import { readFile } from 'fs/promises'; // we need a wrapper script because altool tends to error out very often // https://developer.apple.com/forums/thread/698477 @@ -15,8 +16,11 @@ const bundleId = args[4]; // seems to be the same const ascPublicId = apiIssuer; +const packageJson = JSON.parse(await readFile(new URL('../package.json', import.meta.url))); -const packageVersion = process.env.npm_package_version; +console.log('Using version', packageJson.version); + +const packageVersion = packageJson.version; // const packageVersion = '3.39.2'; const bundleVersion = packageVersion;