From d2874f6a4931e4e6790f7859ec48d78735932402 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Mon, 18 Jul 2022 13:12:03 -0700 Subject: bump examples --- misctools/publish-examples.js | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'misctools/publish-examples.js') diff --git a/misctools/publish-examples.js b/misctools/publish-examples.js index b774e234f..d84466e15 100644 --- a/misctools/publish-examples.js +++ b/misctools/publish-examples.js @@ -77,20 +77,32 @@ for (let folder of examplesFolderEntries) { } catch (exception) {} restart: while (retryCount-- > 0) { - packageJSON.version = version; + packageJSON.version = require("semver").inc(packageJSON.version, "patch"); if ("private" in packageJSON) delete packageJSON.private; if ("license" in packageJSON) delete packageJSON.license; + if ("main" in packageJSON && !("module" in packageJSON)) { + packageJSON.module = packageJSON.main; + delete packageJSON.main; + } fs.writeFileSync( path.join(absolute, "package.json"), JSON.stringify(packageJSON, null, 2) ); - exec(`npm version patch --force`, { cwd: absolute }); + try { + exec(`npm version patch --force --no-commit-hooks --no-git-tag-version`, { + cwd: absolute, + }); - packageJSON = JSON.parse( - fs.readFileSync(path.join(absolute, "package.json"), "utf8") - ); - version = packageJSON.version; + packageJSON = JSON.parse( + fs.readFileSync(path.join(absolute, "package.json"), "utf8") + ); + version = packageJSON.version; + } catch (e) { + if (e.code !== "E404") { + throw e; + } + } try { exec( -- cgit v1.2.3