diff --git a/lib/prepublish/prepublish.js b/lib/prepublish/prepublish.js index 7f02b5ad1..ea4a2d87a 100644 --- a/lib/prepublish/prepublish.js +++ b/lib/prepublish/prepublish.js @@ -1,10 +1,6 @@ const { resolve } = require("path"); const { writeFileSync } = require("fs"); -// if (!process.env.VERDACCIO_AUTH) { -// return; -// } - function pad2(n) {// always returns a string return (n < 10 ? "0" : "") + n; } @@ -20,8 +16,10 @@ const version = d.getFullYear() + const packageJSON = require("../../package.json"); -packageJSON.version = `2.0.${version}`; +const versionChars = packageJSON.version.split("."); -writeFileSync(resolve(__dirname, "../../package.json"), JSON.stringify(packageJSON, null, 2)); +versionChars[versionChars.length - 1] = version; -// writeFileSync(resolve(__dirname, "../../.npmrc"), `//192.168.5.154:4873/:_authToken="${process.env.VERDACCIO_AUTH}"`); +packageJSON.version = versionChars.join("."); + +writeFileSync(resolve(__dirname, "../../package.json"), JSON.stringify(packageJSON, null, 2));