mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-15 08:17:07 +00:00
use package version if it is the latest
This commit is contained in:
parent
888ea80ea1
commit
ccd8681a99
1 changed files with 7 additions and 1 deletions
|
@ -16,10 +16,16 @@ version = version.split('.')
|
||||||
version[2] = parseInt(version[2]) + 1
|
version[2] = parseInt(version[2]) + 1
|
||||||
//put it back in semver
|
//put it back in semver
|
||||||
version = version.join('.')
|
version = version.join('.')
|
||||||
console.log(`incrementing to version ${version}`)
|
|
||||||
|
|
||||||
//write it to the package.json
|
//write it to the package.json
|
||||||
const packageFile = '../package.json'
|
const packageFile = '../package.json'
|
||||||
const package = JSON.parse(fs.readFileSync(packageFile, 'utf-8'))
|
const package = JSON.parse(fs.readFileSync(packageFile, 'utf-8'))
|
||||||
|
|
||||||
|
//if the package version if the latest, go with that one
|
||||||
|
if (semver.gt(package.version, version)){
|
||||||
|
version = package.version
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`incrementing to version ${version}`)
|
||||||
package.version = version
|
package.version = version
|
||||||
fs.writeFileSync(packageFile, JSON.stringify(package, undefined, ' '))
|
fs.writeFileSync(packageFile, JSON.stringify(package, undefined, ' '))
|
||||||
|
|
Loading…
Reference in a new issue