dump command fixes

This commit is contained in:
Juan Ferrer 2022-03-17 22:45:05 +01:00
parent 7b55e54091
commit 45ea00f7d1
3 changed files with 12 additions and 6 deletions

View File

@ -209,8 +209,10 @@ class Push {
console.log('Applying changed routines.'); console.log('Applying changed routines.');
const gitExists = await fs.pathExists(`${opts.workspace}/.git`);
let nRoutines = 0; let nRoutines = 0;
let changes = await fs.pathExists(`${opts.workspace}/.git`) let changes = gitExists
? await myvc.changedRoutines(version.gitCommit) ? await myvc.changedRoutines(version.gitCommit)
: await myvc.cachedChanges(); : await myvc.cachedChanges();
changes = this.parseChanges(changes); changes = this.parseChanges(changes);
@ -319,11 +321,13 @@ class Push {
} else } else
console.log(` -> No routines changed.`); console.log(` -> No routines changed.`);
if (gitExists) {
const repo = await nodegit.Repository.open(this.opts.workspace); const repo = await nodegit.Repository.open(this.opts.workspace);
const head = await repo.getHeadCommit(); const head = await repo.getHeadCommit();
if (version.gitCommit !== head.sha()) if (version.gitCommit !== head.sha())
await this.updateVersion('gitCommit', head.sha()); await this.updateVersion('gitCommit', head.sha());
}
// Update and release // Update and release

View File

@ -1,6 +1,6 @@
{ {
"name": "myvc", "name": "myvc",
"version": "1.3.1", "version": "1.3.2",
"author": "Verdnatura Levante SL", "author": "Verdnatura Levante SL",
"description": "MySQL Version Control", "description": "MySQL Version Control",
"license": "GPL-3.0", "license": "GPL-3.0",

View File

@ -34,9 +34,11 @@ COPY \
structure.sql \ structure.sql \
myvc.js \ myvc.js \
myvc-push.js \ myvc-push.js \
lib.js \
myvc.default.yml \ myvc.default.yml \
db.ini \ db.ini \
./ ./
COPY exporters exporters
RUN ln -s /myvc/myvc.js /usr/local/bin/myvc RUN ln -s /myvc/myvc.js /usr/local/bin/myvc
WORKDIR /workspace WORKDIR /workspace