You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The full error is:
Error: Invalid theme slug specified. The target directory '/home/apweb/public_html/deploy/../testchild4/wp-content/themes/apb-evolve-testchild4' is not in '/home/apweb/public_html/deploy/../testchild4/wp-content/themes'
I am running the command from the "deploy" folder, and my WP install is in ../testchild4.
The path:
/home/apweb/public_html/deploy/../testchild4/wp-content/themes/apb-evolve-testchild4
Is certainly inside:
/home/apweb/public_html/deploy/../testchild4/wp-content/themes
I traced the issue to Scaffold_Command.php in check_target_directory() and in this case $parent_dir is:
/home/apweb/public_html/testchild4/wp-content/themes.
So the string match is failing, but it's the exact same folder.
Wrapping the str_replace() path with realpath() fixes this issue.
The text was updated successfully, but these errors were encountered:
parent_dir contains a normalized path whereas WP_CONTENT_DIR contains a relative path. By running the WP_CONTENT_DIR through realpath we get a path we can actually compare between the target dir and where we want to place the new theme.
Also fixeswp-cli#251
I'm hitting this Invalid theme slug issue when I am running wp-cli from a different folder to the Wordpress installation.
My full command is:
The full error is:
Error: Invalid theme slug specified. The target directory '/home/apweb/public_html/deploy/../testchild4/wp-content/themes/apb-evolve-testchild4' is not in '/home/apweb/public_html/deploy/../testchild4/wp-content/themes'
I am running the command from the "deploy" folder, and my WP install is in ../testchild4.
The path:
/home/apweb/public_html/deploy/../testchild4/wp-content/themes/apb-evolve-testchild4
Is certainly inside:
/home/apweb/public_html/deploy/../testchild4/wp-content/themes
I traced the issue to Scaffold_Command.php in check_target_directory() and in this case $parent_dir is:
/home/apweb/public_html/testchild4/wp-content/themes.
So the string match is failing, but it's the exact same folder.
Wrapping the str_replace() path with realpath() fixes this issue.
The text was updated successfully, but these errors were encountered: