refs #6204 skip files from other environments
This commit is contained in:
parent
693e8d1bc0
commit
b503cbfa9f
18
myt-push.js
18
myt-push.js
|
@ -151,6 +151,21 @@ class Push extends Command {
|
||||||
function isUndoScript(script) {
|
function isUndoScript(script) {
|
||||||
return /\.undo\.sql$/.test(script);
|
return /\.undo\.sql$/.test(script);
|
||||||
}
|
}
|
||||||
|
function isOtherEnvScript(script, env) {
|
||||||
|
const splitScript = script.split('.');
|
||||||
|
const envPart = splitScript[splitScript.length - 2];
|
||||||
|
|
||||||
|
if (splitScript.length <= 2) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!env) {
|
||||||
|
return !!envPart;
|
||||||
|
}
|
||||||
|
|
||||||
|
return envPart && envPart !== env;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const skipFiles = new Set([
|
const skipFiles = new Set([
|
||||||
'README.md',
|
'README.md',
|
||||||
|
@ -210,6 +225,9 @@ class Push extends Command {
|
||||||
if (isUndoScript(script))
|
if (isUndoScript(script))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (isOtherEnvScript(script, opts.env))
|
||||||
|
continue;
|
||||||
|
|
||||||
const [[row]] = await conn.query(
|
const [[row]] = await conn.query(
|
||||||
`SELECT errorNumber FROM versionLog
|
`SELECT errorNumber FROM versionLog
|
||||||
WHERE code = ?
|
WHERE code = ?
|
||||||
|
|
Loading…
Reference in New Issue