Skip to content
New issue

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

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

Already on GitHub? # to your account

Unable to use custom artisan path when using make:migration #361

Open
trajche opened this issue Mar 27, 2024 · 2 comments
Open

Unable to use custom artisan path when using make:migration #361

trajche opened this issue Mar 27, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@trajche
Copy link
Contributor

trajche commented Mar 27, 2024

Version

4.0

What did you expect to happen?

When using the artisan command make:migration, you are able to define a custom path relative to the application of where you would like to store the migrations. In this case, the goal was to store the migrations in a plugin directory, rather than the acorn default which sets the path to the theme directory.

What actually happens?

When using --path as a parameter, it's wp that inherits it rather than acorn (artisan), since you are also able to define a WordPress path when using WP CLI.

Steps to reproduce

  1. Install a Bedrock / WordPress instance
  2. Go to any directory and run wp acorn make:migration create_example_table --path=web/app/plugins/testplugin/
  3. You should get the error Warning: No WordPress installation found. since it's looking for WordPress in web/app/plugins/testplugin/

System info

No response

Log output

No response

Please confirm this isn't a support request.

Yes

@trajche trajche added the bug Something isn't working label Mar 27, 2024
@QWp6t
Copy link
Member

QWp6t commented Apr 4, 2024

Until wp-cli supports -- as a delimiter to separate options from operands, we cannot provide a way to support this without resorting to janky solutions.

Guideline 10:
The first -- argument that is not an option-argument should be accepted as a delimiter indicating the end of options. Any following arguments should be treated as operands, even if they begin with the '-' character.

In the meantime, you can use the Acorn binary to get around this.

./vendor/bin/acorn make:migration create_example_table --path=web/app/plugins/testplugin/

image

@trajche
Copy link
Contributor Author

trajche commented May 18, 2024

I implemented the following (probably janky) solution in the bootloader so that we can use --artisan-path (and pass it as path to acorn) temporarily. #377

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants