From 4517504b14d26a1c5bb2a747e9b90d67179c5167 Mon Sep 17 00:00:00 2001 From: iapyang Date: Wed, 8 Jan 2020 14:51:26 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E6=89=93=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/publish/publish.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/publish/publish.js b/lib/publish/publish.js index 7506fd72b..27280672b 100644 --- a/lib/publish/publish.js +++ b/lib/publish/publish.js @@ -1,3 +1,11 @@ const { execSync } = require("child_process"); +const { resolve } = require("path"); +const { writeFileSync } = require("fs"); -execSync(`npm publish --tag 2.0.${new Date().getTime()}`); +const packageJSON = require("../../package.json"); + +packageJSON.version = `2.0.${new Date().getTime()}`; + +writeFileSync(resolve(__dirname, "../../package.json"), JSON.stringify(packageJSON, null, 2)); + +execSync("npm publish");