简单更新 package 版本


// const commitId = (() => require('child_process').execSync(`git rev-parse HEAD`).toString().trim())();

const fs = require(`fs`)
const package = require(`./package.json`)
const newVersion = package.version.replace(/(.*)(d+$)/, ($0, $1, $2) => $1+(+$2+1))
package.version = newVersion
fs.writeFileSync(`./package.json`, JSON.stringify(package, null, 2))
原文地址:https://www.cnblogs.com/daysme/p/14985737.html