wp-lemon-create 1.1.3 → 1.2.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/lib/index.js +30 -6
- package/package.json +3 -6
package/lib/index.js
CHANGED
|
@@ -5,7 +5,6 @@ const { program } = require('commander');
|
|
|
5
5
|
var shell = require('shelljs');
|
|
6
6
|
const commandName = 'wp-lemon-create';
|
|
7
7
|
const { engines, version } = require('../package.json');
|
|
8
|
-
var async = require('async');
|
|
9
8
|
const prompt = require('prompt-sync')();
|
|
10
9
|
|
|
11
10
|
program
|
|
@@ -29,6 +28,7 @@ program
|
|
|
29
28
|
var is_wsl = false;
|
|
30
29
|
var plugins_searchwp = false;
|
|
31
30
|
var plugins_wpml = false;
|
|
31
|
+
var is_spinup = false;
|
|
32
32
|
|
|
33
33
|
console.log(`Starting $${commandName} @${version}`);
|
|
34
34
|
|
|
@@ -86,6 +86,7 @@ program
|
|
|
86
86
|
password = prompt('WordPress password:');
|
|
87
87
|
plugins_searchwp = prompt('Add plugin: SearchWP? yes/no (defaults to no)', 'no');
|
|
88
88
|
plugins_wpml = prompt('Add plugin: WPML? yes/no (defaults to no)', 'no');
|
|
89
|
+
is_spinup = prompt('Does the project run on Spinup-wp? (defaults to no)', 'no');
|
|
89
90
|
} else if (projecttype == 'existing') {
|
|
90
91
|
project_repository = prompt('Existing repository link in ssh format:');
|
|
91
92
|
} else {
|
|
@@ -126,8 +127,15 @@ program
|
|
|
126
127
|
* Add composer packages
|
|
127
128
|
*/
|
|
128
129
|
shell.echo('Installing plugins, master theme and packages. This may take a while\n');
|
|
129
|
-
shell.exec('composer require highground/bulldozer log1x/acf-editor-palette satispress/advanced-custom-fields-pro satispress/fluentformpro satispress/lemon-blocks satispress/quartermaster satispress/wp-lemon satispress/wp-migrate-db-pro satispress/wp-migrate-db-pro-media-files
|
|
130
|
-
|
|
130
|
+
shell.exec('composer require highground/bulldozer log1x/acf-editor-palette satispress/advanced-custom-fields-pro satispress/fluentformpro satispress/lemon-blocks satispress/quartermaster satispress/wp-lemon satispress/wp-migrate-db-pro satispress/wp-migrate-db-pro-media-files wpackagist-plugin/limit-login-attempts-reloaded timber/timber wpackagist-plugin/cookie-law-info wpackagist-plugin/fluentform wpackagist-plugin/seo-by-rank-math wpackagist-plugin/simple-custom-post-order wpackagist-plugin/worker wpackagist-plugin/wp-mail-smtp --with-all-dependencies', { silent: true });
|
|
131
|
+
shell.exec('composer remove squizlabs/php_codesnifferes roave/security-advisories', { silent: true });
|
|
132
|
+
|
|
133
|
+
if (is_spinup == 'yes') {
|
|
134
|
+
shell.exec('composer require wpackagist-plugin/spinupwp', { silent: true });
|
|
135
|
+
} else {
|
|
136
|
+
shell.exec('composer require satispress/wp-rocket', { silent: true });
|
|
137
|
+
}
|
|
138
|
+
|
|
131
139
|
if(plugins_searchwp == 'yes'){
|
|
132
140
|
shell.exec('composer require satispress/searchwp wpackagist-plugin/searchwp-live-ajax-search', { silent: true });
|
|
133
141
|
}
|
|
@@ -255,6 +263,7 @@ program
|
|
|
255
263
|
shell.echo('✔️ Installing WordPress succesful.');
|
|
256
264
|
shell.exec(`wp rewrite structure '/%postname%/'`, { silent: true });
|
|
257
265
|
shell.echo('✔️ Setting permalink structure.');
|
|
266
|
+
|
|
258
267
|
shell.exec(`wp theme activate ${projectname}`, { silent: true });
|
|
259
268
|
shell.echo(`✔️ Activating child theme ${projectname}`);
|
|
260
269
|
|
|
@@ -275,11 +284,26 @@ program
|
|
|
275
284
|
shell.exec(`wp menu location assign Hoofdmenu primary_navigation`, { silent: true });
|
|
276
285
|
shell.echo('✔️ Created primary menu.');
|
|
277
286
|
|
|
287
|
+
} else {
|
|
288
|
+
shell.echo('Creating Database.\n');
|
|
289
|
+
|
|
290
|
+
if (shell.exec(`wp db create`, { silent: true }).code !== 0) {
|
|
291
|
+
shell.echo('Database creation failed.');
|
|
292
|
+
} else {
|
|
293
|
+
shell.echo('✔️ Database created.');
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Wait until user adds site and presses a key.
|
|
299
|
+
*/
|
|
300
|
+
shell.echo('You can import your database by placing the .sql dump in the project root and run wp db import databasename.sql.');
|
|
301
|
+
prompt('Please import your database and uploads. After that press enter to continue.');
|
|
302
|
+
|
|
303
|
+
// Flush rewrite rules
|
|
304
|
+
shell.exec(`wp rewrite flush`);
|
|
278
305
|
}
|
|
279
306
|
|
|
280
|
-
// Flush rewrite rules
|
|
281
|
-
shell.exec(`wp rewrite flush`, { silent: true });
|
|
282
|
-
|
|
283
307
|
shell.echo(`\n`);
|
|
284
308
|
shell.echo(`🎉 All done! Happy developing!`);
|
|
285
309
|
shell.echo(`🌐 You can now navigate to http://${projectname + tld}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wp-lemon-create",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "Bootstrap your wp-lemon project",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Erik van der bas",
|
|
@@ -9,11 +9,8 @@
|
|
|
9
9
|
"wp-lemon-create": "./index.js"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"
|
|
13
|
-
"check-node-version": "^4.1.0",
|
|
14
|
-
"commander": "^8.3.0",
|
|
12
|
+
"commander": "^9.0.0",
|
|
15
13
|
"prompt-sync": "^4.2.0",
|
|
16
|
-
"shelljs": "^0.8.
|
|
17
|
-
"wrappy": "^1.0.2"
|
|
14
|
+
"shelljs": "^0.8.5"
|
|
18
15
|
}
|
|
19
16
|
}
|