wp-lemon-create 1.2.4 → 1.2.7
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 +15 -11
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -26,6 +26,7 @@ program
|
|
|
26
26
|
var DBuser = '';
|
|
27
27
|
var DBpassword = '';
|
|
28
28
|
var is_wsl = false;
|
|
29
|
+
var child_theme_folder = '';
|
|
29
30
|
var plugins_searchwp = false;
|
|
30
31
|
var plugins_wpml = false;
|
|
31
32
|
var is_spinup = false;
|
|
@@ -73,6 +74,7 @@ program
|
|
|
73
74
|
|
|
74
75
|
shell.echo('\n');
|
|
75
76
|
const projectname = prompt('What is the project name (only lowercase and -, no spaces. Do not add tld (.local/.test):');
|
|
77
|
+
child_theme_folder = projectname;
|
|
76
78
|
const tld = prompt('What is the project tld? (defaults to .local):', '.local');
|
|
77
79
|
|
|
78
80
|
const projecttype = prompt('Project type? new or existing (defaults to new):', 'new');
|
|
@@ -83,7 +85,7 @@ program
|
|
|
83
85
|
project_repository = prompt('Git repository link:');
|
|
84
86
|
username = prompt('WordPress username:');
|
|
85
87
|
email = prompt('WordPress email:');
|
|
86
|
-
password = prompt('WordPress password:');
|
|
88
|
+
password = prompt('WordPress password:',{echo: '*'});
|
|
87
89
|
plugins_searchwp = prompt('Add plugin: SearchWP? yes/no (defaults to no)', 'no');
|
|
88
90
|
plugins_wpml = prompt('Add plugin: WPML? yes/no (defaults to no)', 'no');
|
|
89
91
|
is_spinup = prompt('Does the project run on Spinup-wp? (defaults to no)', 'no');
|
|
@@ -128,7 +130,7 @@ program
|
|
|
128
130
|
*/
|
|
129
131
|
shell.echo('Installing plugins, master theme and packages. This may take a while\n');
|
|
130
132
|
|
|
131
|
-
shell.exec('require composer/installers ~1.0', { silent: true });
|
|
133
|
+
shell.exec('composer require composer/installers ~1.0', { silent: true });
|
|
132
134
|
|
|
133
135
|
// Add libraries and parent theme
|
|
134
136
|
shell.exec('composer require highground/bulldozer timber/timber satispress/wp-lemon --with-all-dependencies', { silent: true });
|
|
@@ -174,9 +176,9 @@ program
|
|
|
174
176
|
shell.echo('Downloading child theme.\n');
|
|
175
177
|
shell.cd('web/app/themes/');
|
|
176
178
|
|
|
177
|
-
shell.exec(`composer create-project --repository https://packagist.studiolemon.nl/satispress/ satispress/wp-lemon-child ${
|
|
179
|
+
shell.exec(`composer create-project --repository https://packagist.studiolemon.nl/satispress/ satispress/wp-lemon-child ${child_theme_folder}`, { silent: true });
|
|
178
180
|
|
|
179
|
-
shell.cd(
|
|
181
|
+
shell.cd(child_theme_folder);
|
|
180
182
|
shell.rm('-rf', '.github');
|
|
181
183
|
shell.echo('✔️ Downloading child theme succesful.');
|
|
182
184
|
|
|
@@ -193,16 +195,18 @@ program
|
|
|
193
195
|
}
|
|
194
196
|
|
|
195
197
|
shell.cd('web/app/themes/');
|
|
196
|
-
shell.cd(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
198
|
+
if (shell.cd(child_theme_folder).code !== 0){
|
|
199
|
+
shell.echo('Error: Child theme not found');
|
|
200
|
+
var child_theme_folder = prompt('Folder name of child theme:');
|
|
201
|
+
shell.cd(child_theme_folder);
|
|
202
|
+
}
|
|
203
|
+
|
|
200
204
|
/**
|
|
201
205
|
* Create child theme config file
|
|
202
206
|
*/
|
|
203
207
|
shell.cp('resources/assets/config.json.example', 'resources/assets/config.json');
|
|
204
208
|
shell.sed('-i', 'http://wplemon.local', `http://${projectname + tld}`, 'resources/assets/config.json');
|
|
205
|
-
shell.sed('-i', 'wp-lemon-child',
|
|
209
|
+
shell.sed('-i', 'wp-lemon-child', child_theme_folder, 'resources/assets/config.json');
|
|
206
210
|
shell.sed('-i', 'wp-lemon child', projectname, 'style.css');
|
|
207
211
|
shell.echo('✔️ Configuring child theme succesful.\n');
|
|
208
212
|
|
|
@@ -271,8 +275,8 @@ program
|
|
|
271
275
|
shell.exec(`wp rewrite structure '/%postname%/'`, { silent: true });
|
|
272
276
|
shell.echo('✔️ Setting permalink structure.');
|
|
273
277
|
|
|
274
|
-
shell.exec(`wp theme activate ${
|
|
275
|
-
shell.echo(`✔️ Activating child theme ${
|
|
278
|
+
shell.exec(`wp theme activate ${child_theme_folder}`, { silent: true });
|
|
279
|
+
shell.echo(`✔️ Activating child theme ${child_theme_folder}`);
|
|
276
280
|
|
|
277
281
|
shell.exec(`wp post update 2 --post_title='Home'`, { silent: true });
|
|
278
282
|
shell.exec(`wp option update show_on_front 'page'`, { silent: true });
|