From 2f1b568e89759be7e1ab9f9dac66e916a8b88456 Mon Sep 17 00:00:00 2001 From: Tycho Bokdam Date: Sun, 28 Jun 2020 20:26:27 +0200 Subject: [PATCH] refactor: Added some TODO's --- src/version/json.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/version/json.js b/src/version/json.js index 51c684a..a349d4d 100644 --- a/src/version/json.js +++ b/src/version/json.js @@ -30,10 +30,12 @@ module.exports = new (class JSON { */ bump = (releaseType) => { // 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) { case 'major': major = parseInt(major, 10) + 1 @@ -50,12 +52,12 @@ module.exports = new (class JSON { 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 - packageJson[this.versionPath] = this.newVersion = `${major}.${minor}.${patch}` + jsonFile[this.versionPath] = this.newVersion = `${major}.${minor}.${patch}` // Update the JSON file - this.update(packageJson) + this.update(jsonFile) } /**