|
|
@ -4,6 +4,7 @@ const fse = require('fs-extra');
|
|
|
|
program.version('0.0.1');
|
|
|
|
program.version('0.0.1');
|
|
|
|
program.option('-n, --nextVersion', 'version in common.props');
|
|
|
|
program.option('-n, --nextVersion', 'version in common.props');
|
|
|
|
program.option('-r, --rc', 'whether version is rc');
|
|
|
|
program.option('-r, --rc', 'whether version is rc');
|
|
|
|
|
|
|
|
program.option('-cv, --customVersion <customVersion>', 'set exact version');
|
|
|
|
|
|
|
|
|
|
|
|
program.parse(process.argv);
|
|
|
|
program.parse(process.argv);
|
|
|
|
|
|
|
|
|
|
|
@ -12,6 +13,7 @@ if (program.nextVersion) console.log(getVersion());
|
|
|
|
if (program.rc) console.log(getVersion().includes('rc'));
|
|
|
|
if (program.rc) console.log(getVersion().includes('rc'));
|
|
|
|
|
|
|
|
|
|
|
|
function getVersion() {
|
|
|
|
function getVersion() {
|
|
|
|
|
|
|
|
if (program.customVersion) return program.customVersion;
|
|
|
|
const commonProps = fse.readFileSync('../common.props').toString();
|
|
|
|
const commonProps = fse.readFileSync('../common.props').toString();
|
|
|
|
const versionTag = '<Version>';
|
|
|
|
const versionTag = '<Version>';
|
|
|
|
const versionEndTag = '</Version>';
|
|
|
|
const versionEndTag = '</Version>';
|
|
|
|