From 51aebafddbe2320938af20231cd807008fd4c49c Mon Sep 17 00:00:00 2001 From: iapyang Date: Thu, 9 Jan 2020 19:56:59 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BF=AE=E6=94=B9=E6=89=93=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/prepublish/prepublish.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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));