Skip to content

Commit dbda1d5

Browse files
authored
Merge pull request #872 from wp-cli/copilot/fix-wp-config-mustache-file
Fix phar path resolution when renamed from wp-cli.phar
2 parents f5ba5e6 + 6bc67e4 commit dbda1d5

2 files changed

Lines changed: 22 additions & 5 deletions

File tree

‎composer.lock‎

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎features/bootstrap.feature‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,20 @@ Feature: Bootstrap WP-CLI
8181
Status: Inactive
8282
"""
8383
And STDERR should be empty
84+
85+
Scenario: Config template resolves when the PHAR is renamed and run against another path
86+
87+
# Reproduces the reported failure: a Phar renamed away from `wp-cli.phar`
88+
# (here without an extension) generating a wp-config.php for an install in a
89+
# different directory via --path. See https://github.com/wp-cli/config-command/issues/141
90+
Given an empty directory
91+
And a new Phar with the same version
92+
93+
When I run `cp {PHAR_PATH} wp-renamed`
94+
And I run `php wp-renamed core download --path=subfolder`
95+
And I run `php wp-renamed config create --path=subfolder --dbname=wordpress --dbuser=root --dbpass=password --skip-check`
96+
Then STDOUT should contain:
97+
"""
98+
Success: Generated 'wp-config.php' file.
99+
"""
100+
And STDERR should be empty

0 commit comments

Comments
 (0)