wp-blank-scripts 2.6.2 → 2.6.3
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/cli/deploy.js +0 -1
- package/lib/deployProject.js +8 -1
- package/package.json +1 -1
- package/utils/getMostRecentSqlFile.js +3 -3
package/cli/deploy.js
CHANGED
|
@@ -8,7 +8,6 @@ const { DEPLOY_OPTIONS, DEPLOY_MODES } = require('../constants');
|
|
|
8
8
|
|
|
9
9
|
const getSettings = require('../utils/projectSettings');
|
|
10
10
|
const exitWithError = require('../utils/exitWithError');
|
|
11
|
-
// TODO: Move into function
|
|
12
11
|
const settings = getSettings();
|
|
13
12
|
const logger = require('../logger');
|
|
14
13
|
|
package/lib/deployProject.js
CHANGED
|
@@ -15,6 +15,7 @@ const { DEPLOY_MODES } = require('../constants');
|
|
|
15
15
|
const getProjectPath = require('../utils/getProjectPath');
|
|
16
16
|
const getSettings = require('../utils/projectSettings');
|
|
17
17
|
const logger = require('../logger');
|
|
18
|
+
const replaceSQL = require('../utils/replaceSQL');
|
|
18
19
|
|
|
19
20
|
// Default options
|
|
20
21
|
const defaultOptions = {
|
|
@@ -272,10 +273,16 @@ module.exports = async (selectOptions, callbacks) => {
|
|
|
272
273
|
await createTunnel();
|
|
273
274
|
await connectMySQL();
|
|
274
275
|
const file = isCI()
|
|
275
|
-
? getMostRecentSqlFile()
|
|
276
|
+
? getMostRecentSqlFile(true)
|
|
276
277
|
: await exportSql({ environment: options.environment });
|
|
277
278
|
|
|
278
279
|
if (file) {
|
|
280
|
+
await replaceSQL({
|
|
281
|
+
environmentIn: 'local',
|
|
282
|
+
environmentOut: options.environment,
|
|
283
|
+
file,
|
|
284
|
+
});
|
|
285
|
+
|
|
279
286
|
await deployMySQL(file);
|
|
280
287
|
}
|
|
281
288
|
|
package/package.json
CHANGED
|
@@ -11,12 +11,12 @@ function getMostRecentFile(files) {
|
|
|
11
11
|
return sortedFiles[0];
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
function getMostRecentSqlFile() {
|
|
14
|
+
function getMostRecentSqlFile(localOnly = false) {
|
|
15
15
|
const settings = getSettings();
|
|
16
16
|
const sqlDir = settings.directories.sql;
|
|
17
|
-
const sqlFiles = glob.sync(`${sqlDir}/**/*.sql`);
|
|
17
|
+
const sqlFiles = glob.sync(localOnly ? `${sqlDir}/**/EXPORT-LOCAL-*.sql` : `${sqlDir}/**/*.sql`);
|
|
18
18
|
|
|
19
19
|
return getMostRecentFile(sqlFiles);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
module.exports = getMostRecentSqlFile
|
|
22
|
+
module.exports = getMostRecentSqlFile;
|