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.
Summary
This is just a quick and dirty experiment. It adds
alias <script>=<path-to-script>
for every script. This can unlock two potentially useful things:devbox shell
, they could potentially just type<script>
instead ofdevbox run <script>
and execute the script they want. That said, if you run it directly, the script would be executing within thedevbox shell
environment, so it may not behave exactly the same as if it were run withdevbox run
, which is a bit more strict/pure. Of course, the user could still run withdevbox run
if they wanted the other behavior.This is just a proof-of-concept. I don't know if
alias
will work with different shells--need to test. I'd also need to add a guard to.hook.sh
, to prevent the hooks from being run multiple times, which isn't a problem today.How was it tested?
Tested a script can call another script, and that I can call a script inside a shell if I manually source
.hooks.sh
. The sourcing would have to be automatic. Haven't tested that or cross-shell support.