wp-lemon-create 2.1.0 → 2.2.0
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/lib/index.js +10 -9
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -25,7 +25,7 @@ let is_spinup = false;
|
|
|
25
25
|
let skipGit = false;
|
|
26
26
|
let branch = false;
|
|
27
27
|
let version_constraints = '*';
|
|
28
|
-
let
|
|
28
|
+
let package_manager = false;
|
|
29
29
|
const hasYarn = shell.which('yarn');
|
|
30
30
|
const hasNpm = shell.which('npm');
|
|
31
31
|
|
|
@@ -65,10 +65,11 @@ program
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
if (!hasYarn && !hasNpm) {
|
|
68
|
-
shell.echo('Yarn
|
|
68
|
+
shell.echo('Yarn and npm are both missing. Please install one of them.');
|
|
69
69
|
shell.exit(1);
|
|
70
70
|
} else {
|
|
71
71
|
shell.echo(`✔️ ${hasYarn ? 'Yarn' : 'Npm'} installed`);
|
|
72
|
+
package_manager = hasYarn ? 'yarn' : 'npm';
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
if (!shell.which('wp')) {
|
|
@@ -111,7 +112,7 @@ program
|
|
|
111
112
|
plugins_searchwp = prompt('Add plugin: SearchWP? yes/no (defaults to no)', 'no');
|
|
112
113
|
plugins_wpml = prompt('Add plugin: WPML? yes/no (defaults to no)', 'no');
|
|
113
114
|
is_spinup = prompt('Does the project run on Spinup-wp? (defaults to no)', 'no');
|
|
114
|
-
is_beta = prompt('Is this a beta project? (defaults to no)', 'no');
|
|
115
|
+
//is_beta = prompt('Is this a beta project? (defaults to no)', 'no');
|
|
115
116
|
|
|
116
117
|
if (project_repository == 'none') {
|
|
117
118
|
skipGit = true;
|
|
@@ -132,9 +133,9 @@ program
|
|
|
132
133
|
|
|
133
134
|
if (project_type == 'new') {
|
|
134
135
|
|
|
135
|
-
if (is_beta) {
|
|
136
|
-
|
|
137
|
-
}
|
|
136
|
+
//if (is_beta) {
|
|
137
|
+
// version_constraints = '^4@beta';
|
|
138
|
+
//}
|
|
138
139
|
|
|
139
140
|
shell.echo('⏳ Downloading Bedrock. This may take a minute or so.\n');
|
|
140
141
|
|
|
@@ -259,11 +260,11 @@ program
|
|
|
259
260
|
* Installing node modules in child theme and parent theme.
|
|
260
261
|
*/
|
|
261
262
|
shell.echo('⏳ Installing npm dependencies. This may take a while.\n');
|
|
262
|
-
if (shell.exec(
|
|
263
|
-
shell.echo(
|
|
263
|
+
if (shell.exec(`${package_manager} run bootstrap-project`, { silent: true }).code !== 0) {
|
|
264
|
+
shell.echo(`Error: ${package_manager} run bootstrap-project failed. Please install node dependencies manually by running ${package_manager} run bootstrap-project in your child theme.`);
|
|
264
265
|
} else {
|
|
265
266
|
shell.echo('✔️ Installing npm dependencies succesful.');
|
|
266
|
-
shell.exec(
|
|
267
|
+
shell.exec(`${package_manager} run dev`, { silent: true });
|
|
267
268
|
shell.echo('✔️ First webpack build succesful.\n');
|
|
268
269
|
}
|
|
269
270
|
|