Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--activate fails after running second time if theme_slug and theme_name are different. #306

Open
2 tasks done
NielsdeBlaauw opened this issue Jun 2, 2022 · 0 comments
Open
2 tasks done

Comments

@NielsdeBlaauw
Copy link

Bug Report

Describe the current, buggy behavior
Run the following commands in order:

$ vendor/bin/wp scaffold child-theme first_run --parent_theme=twentytwenty --theme_name="first_run_name" --activate --path=../../
Success: Created '/srv/www/wordpress-one/public_html/wp-cli-dev/scaffold-command/../../wp-content/themes/first_run'.
Success: Switched to 'first_run_name' theme.
$ rm -rf ../../wp-content/themes/first_run/
$ wp theme activate twentytwenty
$ vendor/bin/wp scaffold child-theme first_run --parent_theme=twentytwenty --theme_name="first_run_name" --activate --path=../../
Success: Created '/srv/www/wordpress-one/public_html/wp-cli-dev/scaffold-command/../../wp-content/themes/first_run'.
Error: The theme directory "first_run" does not exist.

During the second run the command incorrectly looks for first_run instead of first_run_name to switch to.

Describe what you would expect as the correct outcome

I would expect the server to switch to the correct theme.

Let us know what environment you are running this on

$ vendor/bin/wp cli info
OS:	Linux 5.4.0-91-generic #102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021 x86_64
Shell:	/bin/bash
PHP binary:	/usr/bin/php
PHP version:	7.4.29
php.ini used:	/etc/php/7.4/cli/php.ini
MySQL binary:	/usr/bin/mysql
MySQL version:	mysql  Ver 15.1 Distrib 10.5.16-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
SQL modes:	STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
WP-CLI root dir:	/srv/www/wordpress-one/public_html/wp-cli-dev/wp-cli
WP-CLI vendor dir:	/srv/www/wordpress-one/public_html/wp-cli-dev/wp-cli/vendor
WP_CLI phar path:	
WP-CLI packages dir:	/home/vagrant/.wp-cli/packages/
WP-CLI global config:	
WP-CLI project config:	/srv/www/wordpress-one/public_html/wp-cli-dev/scaffold-command/wp-cli.yml
WP-CLI version:	2.7.0-alpha

Provide a possible solution

Provide additional context/Screenshots
Is partially related to #251 as @michaelandre0 already spotted this and I ran into the same situation fixing the path issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants