The --path option of the command `wp core download` is not taken into consideration during the copy of the files https://github.com/wp-cli/wp-cli/blob/master/php/commands/core.php#L20 ``` php $docroot = $assoc_args['path']; ``` https://github.com/wp-cli/wp-cli/blob/master/php/commands/core.php#L40 ``` php WP_CLI::launch( 'cp -r wordpress/* . && rm -rf wordpress' ); ``` Should be ``` php WP_CLI::launch( 'cp -r wordpress/* ' . $docroot . ' && rm -rf wordpress' ); ``` Furthermore, if the $docroot does not exist, try to create it ;)
Activity
scribu commentedon Feb 25, 2013
Nice catch. Care to transform it into a pull request, so that you show up on the contributors page? :)
erwanlr commentedon Feb 25, 2013
Unfortunately, I do not have the time to switch to my dev machine to do so
erwanlr commentedon Feb 26, 2013
Well, it's worse than expected :p
The --path option is not even in the $assoc_args
I've put a var_dump($assoc_args) to see it's content
So, there is something wrong somewhere else :p
scribu commentedon Feb 26, 2013
--pathis a global parameter, which is handled earlier:https://github.com/wp-cli/wp-cli/blob/master/php/WP_CLI/Runner.php#L225
So, the correct fix would be to use
ABSPATH, instead of checking$assoc_args['path'].erwanlr commentedon Feb 26, 2013
That leads to another issue :
scribu commentedon Feb 26, 2013
Ok, so what's the issue?
erwanlr commentedon Feb 26, 2013
w/o the --path option, ABSPATH is an absolute path - no problem with that
however, with the option, it's a relative one
scribu commentedon Feb 26, 2013
Yeah, I guess it should always be absolute, since that's why it's called ABSPATH. :)
That's a bug in
set_wp_root()then.erwanlr commentedon Feb 26, 2013
Should be something like
However, as there is not test for the Runner, I do not want to break something :D
scribu commentedon Feb 26, 2013
Actually, we have functional tests run via Behat, but somehow they don't catch this issue:
https://github.com/wp-cli/wp-cli/blob/master/features/bootstrap/FeatureContext.php#L176-186
scribu commentedon Feb 26, 2013
Going to handle this in #327. Thanks for reporting, @erwanlr.
erwanlr commentedon Feb 26, 2013
I'm currently fixing it :p
Will send a pull request in a few minutes
Ref wp-cli#320, fixes the ABSPATH issue
Fixes wp-cli#320 --path option ignored in core download