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

Implement ability to create per-user and per-project custom commands #172

Merged
merged 4 commits into from
Jun 26, 2020

Conversation

davidalger
Copy link
Collaborator

@davidalger davidalger commented Jun 26, 2020

This PR implements the ability to create custom commands by adding *.cmd and *.help files sourced from ~/.warden/commands and <project>/.warden/commands.

A use-case for this would be to implement a warden bootstrap command for M2 environments operating much in the same way as the ./tools/init.sh script in https://github.com/davidalger/warden-env-magento2 does by adding a .warden/commands/bootstrap.cmd and .warden/commands/bootstrap.help file to the project. Update: The M2 project template now implements the init script as a per-project command, making a great example of how to implement one: wardenenv/warden-env-magento2#8

Another use-case was outlined by @jamescowie at #64 (comment) using the ~/.warden/commands on a per-user basis to provide a set of workflows specific to their org, while using Warden as the workflow tool.

This is something which was been requested on #120 as well as the initial POC for it on PR #64 (thank you @rafashkembi for first posing the idea to everyone in there!)

Some benefits to doing this also means some aspects of these scripts (as they interact with the warden environment itself) can become simpler. For example, any functions available in a Warden execution chain will be available to these custom commands since Warden is sourcing them into it's own context, not running them as sub-processes. You can see that in some of the sections of removed code and more robust help messaging here: https://github.com/davidalger/warden-env-magento2/pull/8/files

….warden/commands, then home .warden/commands
…l pass any and all inputs to the command for it's own parsing routine
@davidalger davidalger added this to the Warden 0.6.0 milestone Jun 26, 2020
@davidalger davidalger self-assigned this Jun 26, 2020
@davidalger davidalger linked an issue Jun 26, 2020 that may be closed by this pull request
@davidalger davidalger mentioned this pull request Jun 26, 2020
@davidalger davidalger merged commit 389c913 into develop Jun 26, 2020
@davidalger davidalger deleted the feature/plugin-support branch June 26, 2020 23:41
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.

Feature Request: Plugin support
1 participant