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

feat(execute): introduce remote execution command #495

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

joelwurtz
Copy link
Member

@joelwurtz joelwurtz commented Jul 26, 2024

Ref #488

This add a new command which allow castor to execute remote package

As an example you could do the following :

castor execute  friendsofphp/php-cs-fixer@php-cs-fixer fix --dry-run --diff

Which will

  • download the friendsofphp/php-cs-fixer package
  • execute the php-cs-fixer binary from it with args fix --dry-run --diff
  • remove the package once it has been executed

It could also use a specific version by doing :

castor execute  friendsofphp/php-cs-fixer:v3.57.1@php-cs-fixer fix --dry-run --diff

TODO :

  • Tests
  • Documentation

@TheoD02
Copy link
Contributor

TheoD02 commented Jul 26, 2024

Hi ✋

It sounds pretty cool to run some PHP tools without the need to create a composer.json file 😄

Remove the package once it has been executed.

In certain scenarios, like when working locally, it might be beneficial to retain these packages rather than removing them each time. What do you think about adding an option to prevent the automatic removal of packages?


One idea that comes to mind is for running tools like PHPStan with extensions. It could be useful to provide additional dependencies, such as phpstan/phpstan-symfony

For example, you could execute the following command:

castor execute --deps phpstan/phpstan-symfony phpstan/phpstan@phpstan xxx

This would allow you to easily add the necessary dependencies for specific tools or extensions.

@joelwurtz joelwurtz force-pushed the feat/remote-execute branch from d361ea7 to 342ca96 Compare August 1, 2024 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants