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

Create a new command to overwrite other commands #28

Merged
merged 16 commits into from
Jul 5, 2024

Conversation

edwtorba
Copy link
Contributor

@edwtorba edwtorba commented Jun 8, 2024

Description:

  • Add the ability to overwrite commands.
  • Add the possibility of doing partial or full overwrites.
  • Add the ability to create completely new custom commands.
  • Add documentation for the new command overwrite.

Functional Testing:

  • Go to a project with fire installed.
  • Run the following command to install the current version:
    lando composer require fourkitchens/fire:dev-feature/v2-overwrite-command --dev
  • Run the following command to overwrite an existing command:
    fire overwrite, choose the command name and the overwrite type.
  • Edit the new command (the console will show you the location of the new command) and run it to test its functionality was overwritten.
  • Run again the command to overwrite: fire overwrite, and respond to the questions. With these steps, a new command should have been created in the custom path, try to run your new command, by default only a task is added that cleans the Drupal cache, but from this file, you can add your custom tasks.

Notes:

I create two types of overwrite:

1. Partial: It first runs the original command and then allows you to add new functionality.
2. Full: It replaces all existing code and allows you to write the command from scratch.

@rigoucr rigoucr added enhancement New feature or request passed review and removed needs review labels Jul 5, 2024
Copy link
Contributor

@rigoucr rigoucr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @edwtorba , works like a charm

@edwtorba edwtorba merged commit 76af502 into 2.x Jul 5, 2024
@edwtorba edwtorba deleted the feature/v2-overwrite-command branch July 5, 2024 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request passed review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants