wp-blank-scripts 3.1.6 → 3.1.8
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/README.md +5 -3
- package/cli/pull.js +11 -11
- package/lib/pullSQL.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -321,9 +321,11 @@ exports.copyFiles = (paths) => {
|
|
|
321
321
|
// Copy all files from vendor (except vivo-digital & johnpbloch) to the theme/inc/vendor
|
|
322
322
|
from: path.join(__dirname, "..", "vendor"),
|
|
323
323
|
to: path.join(themePath, "inc", "vendor"),
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
324
|
+
globOptions: {
|
|
325
|
+
ignore: [
|
|
326
|
+
path.join("@(vivo-digital|johnpbloch)", '**')
|
|
327
|
+
],
|
|
328
|
+
}
|
|
327
329
|
}
|
|
328
330
|
];
|
|
329
331
|
}
|
package/cli/pull.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const chalk = require('chalk');
|
|
2
2
|
const path = require('path');
|
|
3
|
+
const ora = require('ora');
|
|
3
4
|
|
|
4
5
|
const pullSQL = require('../lib/pullSQL');
|
|
5
6
|
const getSettings = require('../utils/projectSettings');
|
|
@@ -8,14 +9,16 @@ const exitWithError = require('../utils/exitWithError');
|
|
|
8
9
|
const logger = require('../logger');
|
|
9
10
|
const { DEPLOY_OPTIONS } = require('../constants');
|
|
10
11
|
|
|
11
|
-
function handleError(err) {
|
|
12
|
+
function handleError(err, spinner) {
|
|
12
13
|
// Show error
|
|
14
|
+
spinner.stop();
|
|
13
15
|
logger.error('Dang! Something went wrong');
|
|
14
16
|
exitWithError(err);
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
function handleFinish(sqlFilePath) {
|
|
19
|
+
function handleFinish(sqlFilePath, spinner) {
|
|
18
20
|
const fileName = path.basename(sqlFilePath);
|
|
21
|
+
spinner.stop();
|
|
19
22
|
logger.success(`Exported ${chalk.yellow(fileName)} successfully!`);
|
|
20
23
|
}
|
|
21
24
|
|
|
@@ -32,7 +35,7 @@ module.exports = async () => {
|
|
|
32
35
|
},
|
|
33
36
|
{
|
|
34
37
|
name: 'serverPassword',
|
|
35
|
-
message: answers => {
|
|
38
|
+
message: (answers) => {
|
|
36
39
|
const user = settings.server[answers.environment].user;
|
|
37
40
|
const host = settings.server[answers.environment].host;
|
|
38
41
|
return chalk.cyan(
|
|
@@ -43,25 +46,22 @@ module.exports = async () => {
|
|
|
43
46
|
},
|
|
44
47
|
{
|
|
45
48
|
name: 'serverPrivateKey',
|
|
46
|
-
message: answers => {
|
|
49
|
+
message: (answers) => {
|
|
47
50
|
const user = settings.server[answers.environment].user;
|
|
48
51
|
const host = settings.server[answers.environment].host;
|
|
49
|
-
return chalk.cyan(
|
|
50
|
-
`Enter the path to your private key for user ${user} on host ${host}`
|
|
51
|
-
);
|
|
52
|
+
return chalk.cyan(`Enter the path to your private key for user ${user} on host ${host}`);
|
|
52
53
|
},
|
|
53
54
|
default: '~/.ssh/id_rsa',
|
|
54
55
|
type: 'input',
|
|
55
|
-
when: answers => !answers.serverPassword,
|
|
56
|
+
when: (answers) => !answers.serverPassword,
|
|
56
57
|
},
|
|
57
58
|
]);
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
const spinner = ora('Starting pull...').start();
|
|
60
61
|
|
|
61
62
|
const sqlFilePath = await pullSQL(options);
|
|
62
63
|
|
|
63
|
-
handleFinish(sqlFilePath);
|
|
64
|
-
|
|
64
|
+
handleFinish(sqlFilePath, spinner);
|
|
65
65
|
} catch (err) {
|
|
66
66
|
handleError(err);
|
|
67
67
|
}
|
package/lib/pullSQL.js
CHANGED
|
@@ -9,7 +9,7 @@ const getProjectPath = require('../utils/getProjectPath');
|
|
|
9
9
|
const getSqlFileName = require('../utils/getSqlFileName');
|
|
10
10
|
const { SQL_BACKUPS_DIR } = require('../constants');
|
|
11
11
|
|
|
12
|
-
module.exports = async options => {
|
|
12
|
+
module.exports = async (options) => {
|
|
13
13
|
const settings = getSettings();
|
|
14
14
|
const server = settings.server[options.environment];
|
|
15
15
|
const { user, password, database } = settings.mysql[options.environment];
|
|
@@ -28,7 +28,7 @@ module.exports = async options => {
|
|
|
28
28
|
fs.mkdirSync(destinationDir, { recursive: true });
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
const command = `mysqldump --user='${user}' --password='${password}' ${database}`;
|
|
31
|
+
const command = `mysqldump --add-drop-table --user='${user}' --password='${password}' ${database}`;
|
|
32
32
|
|
|
33
33
|
let privateKey;
|
|
34
34
|
if (options.serverPrivateKey) {
|
|
@@ -47,7 +47,7 @@ module.exports = async options => {
|
|
|
47
47
|
|
|
48
48
|
stdio.setEncoding('utf8');
|
|
49
49
|
|
|
50
|
-
stdio.on('data', data => {
|
|
50
|
+
stdio.on('data', (data) => {
|
|
51
51
|
writeStream.write(data);
|
|
52
52
|
});
|
|
53
53
|
|
|
@@ -71,7 +71,7 @@ module.exports = async options => {
|
|
|
71
71
|
resolve();
|
|
72
72
|
});
|
|
73
73
|
|
|
74
|
-
stdio.on('exit', code => {
|
|
74
|
+
stdio.on('exit', (code) => {
|
|
75
75
|
exitCode = code;
|
|
76
76
|
});
|
|
77
77
|
});
|