From ad3253026117430adb84c98ddb5593b76931894e Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 7 Feb 2022 15:54:24 +0100 Subject: [PATCH] Push.updateVersion() fixes --- myvc-push.js | 11 ++++------- package.json | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/myvc-push.js b/myvc-push.js index 7006500..9c05d2e 100644 --- a/myvc-push.js +++ b/myvc-push.js @@ -201,7 +201,7 @@ class Push { nChanges++; } - await this.updateVersion(nChanges, 'number', versionNumber); + await this.updateVersion('number', versionNumber); } } @@ -323,7 +323,7 @@ class Push { const head = await repo.getHeadCommit(); if (version.gitCommit !== head.sha()) - await this.updateVersion(nRoutines, 'gitCommit', head.sha()); + await this.updateVersion('gitCommit', head.sha()); // Update and release @@ -339,10 +339,7 @@ class Push { return routines; } - async updateVersion(nChanges, column, value) { - if (nChanges == 0) return; - const {opts} = this; - + async updateVersion(column, value) { column = this.conn.escapeId(column, true); await this.conn.query( `INSERT INTO version @@ -353,7 +350,7 @@ class Push { ${column} = VALUES(${column}), updated = VALUES(updated)`, [ - opts.code, + this.opts.code, value ] ); diff --git a/package.json b/package.json index b38e0be..08a5789 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "myvc", - "version": "1.2.8", + "version": "1.2.9", "author": "Verdnatura Levante SL", "description": "MySQL Version Control", "license": "GPL-3.0",