wp-lemon-create 1.4.5 → 1.5.1

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.
Files changed (2) hide show
  1. package/lib/index.js +26 -7
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -38,6 +38,9 @@ program
38
38
  var skipGit = false;
39
39
  var branch = false;
40
40
 
41
+ if (project_name.endsWith('.local')) {
42
+ project_name = project_name.substring(0, project_name.length - 6);
43
+ }
41
44
 
42
45
  console.log(`Starting $${commandName} @${version}`);
43
46
 
@@ -124,7 +127,7 @@ program
124
127
  shell.echo(`🎉 Setting up ${project_type} wp-lemon project with url ${project_url} \n`);
125
128
 
126
129
  if (project_type == 'new') {
127
- shell.echo('Downloading Bedrock. This may take a minute or so.\n');
130
+ shell.echo('Downloading Bedrock. This may take a minute or so.\n');
128
131
 
129
132
  /**
130
133
  * cloning bedrock and removing unneeded dirs
@@ -138,8 +141,8 @@ program
138
141
  /**
139
142
  * Add bulldozer extended config
140
143
  */
141
- shell.sed('-i', 'env;', 'env;\nuse HighGround\\Bulldozer\\Bulldozer;\n\nBulldozer::extend_roots_config();', 'config/application.php');
142
-
144
+ shell.sed('-i', 'env;', 'env;\nuse HighGround\\Bulldozer\\Bulldozer;\n', 'config/application.php');
145
+ shell.sed('-i', `define('WP_ENV', env('WP_ENV') ?: 'production');`, `define('WP_ENV', env('WP_ENV') ?: 'production');\n\nBulldozer::extend_roots_config();`, 'config/application.php');
143
146
  /**
144
147
  * configuring composer
145
148
  */
@@ -148,7 +151,7 @@ program
148
151
  /**
149
152
  * Add composer packages
150
153
  */
151
- shell.echo('Installing plugins, master theme and packages. This may take a while\n');
154
+ shell.echo('Installing plugins, parent theme and packages. This may take a while\n');
152
155
 
153
156
  shell.exec('composer require composer/installers ~1.0', { silent: true });
154
157
 
@@ -198,7 +201,7 @@ program
198
201
  /**
199
202
  * Downloading child theme
200
203
  */
201
- shell.echo('Downloading child theme.\n');
204
+ shell.echo('Downloading child theme.\n');
202
205
  shell.cd('web/app/themes/');
203
206
 
204
207
  shell.exec(`composer create-project --repository https://packagist.studiolemon.nl/satispress/ satispress/wp-lemon-child ${child_theme_folder} --no-dev`, { silent: true });
@@ -241,7 +244,7 @@ program
241
244
  /**
242
245
  * Installing node modules in child theme and parent theme.
243
246
  */
244
- shell.echo('Installing npm dependencies. This may take a while.\n');
247
+ shell.echo('Installing npm dependencies. This may take a while.\n');
245
248
  if (shell.exec(`yarn run bootstrap-project`, { silent: true }).code !== 0) {
246
249
  shell.echo('Error: yarn run bootstrap-project failed. Please install node dependencies manually by running yarn run bootstrap-project in your child theme.');
247
250
  } else {
@@ -260,6 +263,22 @@ program
260
263
  */
261
264
  shell.cd('../../../../');
262
265
 
266
+ shell.exec(`touch ${project_name}.code-workspace`);
267
+ shell.exec(`echo '{
268
+ "folders": [
269
+ {
270
+ "name": "root",
271
+ "path": "."
272
+ },
273
+ {
274
+ "name": "${project_name}",
275
+ "path": "web/app/themes/${project_name}"
276
+ }
277
+ ]
278
+ }' >> ${project_name}.code-workspace`);
279
+ shell.echo('✔️ .code-workspace file created.\n');
280
+
281
+
263
282
  /**
264
283
  * reload host file so browsersync works without a restart.
265
284
  */
@@ -286,7 +305,7 @@ program
286
305
  }
287
306
 
288
307
  if (project_type == 'new') {
289
- shell.echo('Installing WordPress.\n');
308
+ shell.echo('Installing WordPress.\n');
290
309
 
291
310
  if (shell.exec(`wp db create`, { silent: true }).code !== 0) {
292
311
  shell.echo('Database creation failed.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wp-lemon-create",
3
- "version": "1.4.5",
3
+ "version": "1.5.1",
4
4
  "description": "Bootstrap your wp-lemon project",
5
5
  "main": "index.js",
6
6
  "author": "Erik van der bas",