From 45ea00f7d1bccf4d24e0928500b3916258d22997 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 17 Mar 2022 22:45:05 +0100 Subject: [PATCH] dump command fixes --- myvc-push.js | 14 +++++++++----- package.json | 2 +- server/Dockerfile | 2 ++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/myvc-push.js b/myvc-push.js index 9c05d2e..42603f8 100644 --- a/myvc-push.js +++ b/myvc-push.js @@ -208,9 +208,11 @@ class Push { // Apply routines console.log('Applying changed routines.'); + + const gitExists = await fs.pathExists(`${opts.workspace}/.git`); let nRoutines = 0; - let changes = await fs.pathExists(`${opts.workspace}/.git`) + let changes = gitExists ? await myvc.changedRoutines(version.gitCommit) : await myvc.cachedChanges(); changes = this.parseChanges(changes); @@ -319,11 +321,13 @@ class Push { } else console.log(` -> No routines changed.`); - const repo = await nodegit.Repository.open(this.opts.workspace); - const head = await repo.getHeadCommit(); + if (gitExists) { + const repo = await nodegit.Repository.open(this.opts.workspace); + const head = await repo.getHeadCommit(); - if (version.gitCommit !== head.sha()) - await this.updateVersion('gitCommit', head.sha()); + if (version.gitCommit !== head.sha()) + await this.updateVersion('gitCommit', head.sha()); + } // Update and release diff --git a/package.json b/package.json index b7a8e0c..4e3a507 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "myvc", - "version": "1.3.1", + "version": "1.3.2", "author": "Verdnatura Levante SL", "description": "MySQL Version Control", "license": "GPL-3.0", diff --git a/server/Dockerfile b/server/Dockerfile index 21d693a..38706b7 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -34,9 +34,11 @@ COPY \ structure.sql \ myvc.js \ myvc-push.js \ + lib.js \ myvc.default.yml \ db.ini \ ./ +COPY exporters exporters RUN ln -s /myvc/myvc.js /usr/local/bin/myvc WORKDIR /workspace