diff options
author | 2022-07-18 13:12:03 -0700 | |
---|---|---|
committer | 2022-07-18 13:12:03 -0700 | |
commit | d2874f6a4931e4e6790f7859ec48d78735932402 (patch) | |
tree | e9c4171494e6a6237a1924ce0bfd3c9a47b805c7 /misctools/publish-examples.js | |
parent | a1a0c1847805691ec9398eeff6545119a5ad6566 (diff) | |
download | bun-d2874f6a4931e4e6790f7859ec48d78735932402.tar.gz bun-d2874f6a4931e4e6790f7859ec48d78735932402.tar.zst bun-d2874f6a4931e4e6790f7859ec48d78735932402.zip |
bump examples
Diffstat (limited to 'misctools/publish-examples.js')
-rw-r--r-- | misctools/publish-examples.js | 24 |
1 files changed, 18 insertions, 6 deletions
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( |