refactor: Added some TODO's

releases/v3
Tycho Bokdam 2020-06-28 20:26:27 +02:00
parent d022b0d7e9
commit 2f1b568e89
No known key found for this signature in database
GPG Key ID: A0FAE77C8CDF33C7
1 changed files with 7 additions and 5 deletions

View File

@ -30,10 +30,12 @@ module.exports = new (class JSON {
*/ */
bump = (releaseType) => { bump = (releaseType) => {
// Read the JSON file // Read the JSON file
const packageJson = this.read() const jsonFile = this.read()
let [major, minor, patch] = packageJson.version.split('.') // TODO:: Test and make sure we can use path.to.version
let [major, minor, patch] = jsonFile[this.versionPath].split('.')
// TODO:: Move this to a helper
switch (releaseType) { switch (releaseType) {
case 'major': case 'major':
major = parseInt(major, 10) + 1 major = parseInt(major, 10) + 1
@ -50,12 +52,12 @@ module.exports = new (class JSON {
patch = parseInt(patch, 10) + 1 patch = parseInt(patch, 10) + 1
} }
// Update the package.json with the new version // Update the json file with the new version
// TODO:: Test and make sure we can use path.to.version // TODO:: Test and make sure we can use path.to.version
packageJson[this.versionPath] = this.newVersion = `${major}.${minor}.${patch}` jsonFile[this.versionPath] = this.newVersion = `${major}.${minor}.${patch}`
// Update the JSON file // Update the JSON file
this.update(packageJson) this.update(jsonFile)
} }
/** /**