[wp-trac] [WordPress Trac] #49460: wp-config gets cleaned out from build folder on rebuild

WordPress Trac noreply at wordpress.org
Tue Feb 18 03:01:25 UTC 2020


#49460: wp-config gets cleaned out from build folder on rebuild
------------------------------+-----------------------------
 Reporter:  isabel_brison     |      Owner:  (none)
     Type:  enhancement       |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Build/Test Tools  |    Version:  trunk
 Severity:  normal            |   Keywords:
  Focuses:                    |
------------------------------+-----------------------------
 If there is a `wp-config.php` file in the `build` folder, it gets cleaned
 out when `npm run build` is run.

 This has become a problem because the newest version of `@wordpress/env`
 allows us to setup a unified core/gutenberg development environment from
 the build folder of our local `wordpress-develop`. In doing so, it writes
 a `wp-config.php` to that folder, which gets wiped out on running `npm run
 build`, destroying the development environment.

 In testing a fix for this issue, I came across an existing bug in the
 `clean:files` task: because `BUILD_DIR` gets prepended to the strings in
 the `buildFiles` array, if any of those strings is a negation, it won't
 work because the `!` will now be in the middle of the string, instead of
 at the start.

 I'm adding a patch for both the main issue and the bug.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49460>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list