aqua as "universal interpreter" that installs dependencies of shell scripts on the fly
reitzig opened this issue · 0 comments
reitzig commented
Feature Overview
Looking at pkgx and their "universal interpreter" feature, I wonder if something similar would be feasible for aqua.
Why is the feature needed?
Makes dependencies of shell scripts explicit and painless to "install" -- as long as the user uses aqua, of course. ;)
Workaround
This script kind of works: reitzig/scripts:aquax
Avoiding the intermediate config file would be neater and probably more efficient, though. One might want to tailor the output to the use case, too.
Example Code
#!/usr/bin/env -S aquax +charmbracelet/gum +mikefarah/yq bash
gum log --level info "Aqua registry at $(yq '.registries.[] | select(.type == "standard") | .ref' < ~/.config/aqua/aqua.yaml)"
Or even:
#!/usr/bin/env -S aquax +charmbracelet/gum@v0.14.1 +mikefarah/yq>=4 bash
gum log --level info "Aqua registry at $(yq '.registries.[] | select(.type == "standard") | .ref' < ~/.config/aqua/aqua.yaml)"
NB: Fixed versions work with the workaround script; version ranges don't. (Don't think aqua supports them, either?)
Note
No response