@verdnatura/myt 1.5.12 → 1.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/myt-dump.js +1 -1
- package/myt-push.js +14 -11
- package/package.json +1 -1
package/myt-dump.js
CHANGED
package/myt-push.js
CHANGED
|
@@ -267,8 +267,7 @@ class Push extends Command {
|
|
|
267
267
|
const gitExists = await fs.pathExists(`${opts.workspace}/.git`);
|
|
268
268
|
|
|
269
269
|
let nRoutines = 0;
|
|
270
|
-
|
|
271
|
-
changes = this.parseChanges(changes);
|
|
270
|
+
const changes = await this.changedRoutines(version.gitCommit);
|
|
272
271
|
|
|
273
272
|
const routines = [];
|
|
274
273
|
for (const change of changes)
|
|
@@ -397,14 +396,6 @@ class Push extends Command {
|
|
|
397
396
|
await pushConn.end();
|
|
398
397
|
}
|
|
399
398
|
|
|
400
|
-
parseChanges(changes) {
|
|
401
|
-
const routines = [];
|
|
402
|
-
if (changes)
|
|
403
|
-
for (const change of changes)
|
|
404
|
-
routines.push(new Routine(change));
|
|
405
|
-
return routines;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
399
|
async updateVersion(column, value) {
|
|
409
400
|
column = SqlString.escapeId(column, true);
|
|
410
401
|
await this.conn.query(
|
|
@@ -478,9 +469,21 @@ class Push extends Command {
|
|
|
478
469
|
await pushChanges(await repoExt.getUnstaged(repo));
|
|
479
470
|
await pushChanges(await repoExt.getStaged(repo));
|
|
480
471
|
|
|
481
|
-
|
|
472
|
+
const routines = [];
|
|
473
|
+
for (const change of changes)
|
|
474
|
+
routines.push(new Routine(change));
|
|
475
|
+
|
|
476
|
+
return routines.sort((a, b) => {
|
|
482
477
|
if (b.mark != a.mark)
|
|
483
478
|
return b.mark == '-' ? 1 : -1;
|
|
479
|
+
|
|
480
|
+
if (b.type.name !== a.type.name) {
|
|
481
|
+
if (b.type.name == 'VIEW')
|
|
482
|
+
return -1;
|
|
483
|
+
if (a.type.name == 'VIEW')
|
|
484
|
+
return 1;
|
|
485
|
+
}
|
|
486
|
+
|
|
484
487
|
return a.path.localeCompare(b.path);
|
|
485
488
|
});
|
|
486
489
|
}
|