diff --git a/myvc-dump.js b/myvc-dump.js index fd2285e..3238a8a 100644 --- a/myvc-dump.js +++ b/myvc-dump.js @@ -2,7 +2,7 @@ const MyVC = require('./index'); const fs = require('fs-extra'); const path = require('path'); -const docker = require('./docker').docker; +const docker = require('./docker'); /** * Dumps structure and fixtures from remote. diff --git a/myvc-push.js b/myvc-push.js index 5982e29..ce40f29 100644 --- a/myvc-push.js +++ b/myvc-push.js @@ -1,7 +1,7 @@ const MyVC = require('./index'); const fs = require('fs-extra'); -const path = require('path'); +const nodegit = require('nodegit'); /** * Pushes changes to remote. @@ -132,7 +132,7 @@ class Push { nChanges++; } - //await this.updateVersion(nChanges, 'number', dirVersion); + await this.updateVersion(nChanges, 'number', dirVersion); } } @@ -205,8 +205,11 @@ class Push { await pushConn.end(); if (nRoutines > 0) { + const repo = await nodegit.Repository.open(this.opts.workspace); + const head = await repo.getHeadCommit(); + await conn.query('FLUSH PRIVILEGES'); - //await this.updateVersion(nRoutines, 'gitCommit', version.gitCommit); + await this.updateVersion(nRoutines, 'gitCommit', head.sha()); console.log(` -> ${nRoutines} routines have changed.`); } else diff --git a/package-lock.json b/package-lock.json index 29e8ce8..77f7d9d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "myvc", - "version": "1.1.0", + "version": "1.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -47,9 +47,9 @@ } }, "@types/node": { - "version": "14.14.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.8.tgz", - "integrity": "sha512-z/5Yd59dCKI5kbxauAJgw6dLPzW+TNOItNE00PkpzNwUIEwdj/Lsqwq94H5DdYBX7C13aRA0CY32BK76+neEUA==" + "version": "14.14.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.10.tgz", + "integrity": "sha512-J32dgx2hw8vXrSbu4ZlVhn1Nm3GbeCFNw2FWL8S5QKucHGY0cyNwjdQdO+KMBZ4wpmC7KhLCiNsdk1RFRIYUQQ==" }, "@types/responselike": { "version": "1.0.0", diff --git a/package.json b/package.json index eef95fc..2e2355d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "myvc", - "version": "1.1.1", + "version": "1.1.2", "author": "Verdnatura Levante SL", "description": "MySQL Version Control", "license": "GPL-3.0",