Implement ability to create per-user and per-project custom commands #172
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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#8Another 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