2018-10-25 01:07:40 +08:00
|
|
|
const coreVersion = require('../package.json').version
|
|
|
|
const weexVersion = require('../packages/weex-vue-framework/package.json').version
|
|
|
|
let weexBaseVersion = weexVersion.match(/^[\d.]+/)[0]
|
|
|
|
let weexSubVersion = Number(weexVersion.match(/-weex\.(\d+)$/)[1])
|
2016-11-09 00:03:09 +08:00
|
|
|
|
|
|
|
if (weexBaseVersion === coreVersion) {
|
|
|
|
// same core version, increment sub version
|
|
|
|
weexSubVersion++
|
|
|
|
} else {
|
|
|
|
// new core version, reset sub version
|
2016-11-16 07:11:00 +08:00
|
|
|
weexBaseVersion = coreVersion
|
2016-11-09 00:03:09 +08:00
|
|
|
weexSubVersion = 1
|
|
|
|
}
|
|
|
|
|
|
|
|
if (process.argv[2] === '-c') {
|
|
|
|
console.log(weexVersion)
|
|
|
|
} else {
|
|
|
|
console.log(weexBaseVersion + '-weex.' + weexSubVersion)
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
base: weexBaseVersion,
|
|
|
|
sub: weexSubVersion
|
|
|
|
}
|