From e04a8203dcf8c1cf905f56e0ad834343e152c7ed Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Wed, 15 Feb 2023 03:20:40 +0800 Subject: [PATCH] Fix npm issue for deploy script --- extra/beta/update-version.js | 3 ++- extra/update-version.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/extra/beta/update-version.js b/extra/beta/update-version.js index 7abac5efe..3dafbe8d4 100644 --- a/extra/beta/update-version.js +++ b/extra/beta/update-version.js @@ -22,7 +22,8 @@ if (! exists) { fs.writeFileSync("package.json", JSON.stringify(pkg, null, 4) + "\n"); // Also update package-lock.json - childProcess.spawnSync("npm", [ "install" ]); + const npm = /^win/.test(process.platform) ? "npm.cmd" : "npm"; + childProcess.spawnSync(npm, [ "install" ]); commit(version); tag(version); diff --git a/extra/update-version.js b/extra/update-version.js index 246e1c1c4..8d78f17db 100644 --- a/extra/update-version.js +++ b/extra/update-version.js @@ -26,7 +26,8 @@ if (! exists) { fs.writeFileSync("package.json", JSON.stringify(pkg, null, 4) + "\n"); // Also update package-lock.json - childProcess.spawnSync("npm", [ "install" ]); + const npm = /^win/.test(process.platform) ? "npm.cmd" : "npm"; + childProcess.spawnSync(npm, [ "install" ]); commit(newVersion); tag(newVersion);