We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const fs = require('fs') const childProcess = require('child_process') const util = require('util') const exec = util.promisify(childProcess.exec) const runTask = async function () { let version = '' const pkgStr = fs.readFileSync('./package.json', { encoding: 'utf8' }) const latestPkgStr = pkgStr.replace(/"version": "([\d\.]+)"/, ($0, $1) => { version = $1 return '"version": "latest"' }) console.info('获取到当前的版本为', version) fs.writeFileSync('./package.json', latestPkgStr, 'utf8') console.info('替换为 latest, 执行发布') await exec(`cook up`, { cwd: __dirname }) console.info('发布完成, 恢复原版本') fs.writeFileSync('./package.json', pkgStr, 'utf8') } runTask()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: