mirror of https://github.com/abpframework/abp.git
committed by
GitHub
8 changed files with 60 additions and 31 deletions
@ -1,10 +0,0 @@ |
|||||
const fse = require('fs-extra'); |
|
||||
|
|
||||
const commonProps = fse.readFileSync('../common.props').toString(); |
|
||||
|
|
||||
const versionTag = '<Version>'; |
|
||||
const versionEndTag = '</Version>'; |
|
||||
const first = commonProps.indexOf(versionTag) + versionTag.length; |
|
||||
const last = commonProps.indexOf(versionEndTag); |
|
||||
|
|
||||
console.log(commonProps.substring(first, last)); |
|
||||
@ -0,0 +1,21 @@ |
|||||
|
const { program } = require('commander'); |
||||
|
const fse = require('fs-extra'); |
||||
|
|
||||
|
program.version('0.0.1'); |
||||
|
program.option('-n, --nextVersion', 'version in common.props'); |
||||
|
program.option('-r, --rc', 'whether version is rc'); |
||||
|
|
||||
|
program.parse(process.argv); |
||||
|
|
||||
|
if (program.nextVersion) console.log(getVersion()); |
||||
|
|
||||
|
if (program.rc) console.log(getVersion().includes('rc')); |
||||
|
|
||||
|
function getVersion() { |
||||
|
const commonProps = fse.readFileSync('../common.props').toString(); |
||||
|
const versionTag = '<Version>'; |
||||
|
const versionEndTag = '</Version>'; |
||||
|
const first = commonProps.indexOf(versionTag) + versionTag.length; |
||||
|
const last = commonProps.indexOf(versionEndTag); |
||||
|
return commonProps.substring(first, last); |
||||
|
} |
||||
Loading…
Reference in new issue