mirror of
https://github.com/asdf-vm/asdf.git
synced 2024-11-15 09:38:16 -07:00
ab59e5618f
- Make shim-exec, shim-env, and which use the same logic to look for commands - Make sure shim-exec and which use a plugin exec-path hook as documented (the hook takes a relative path to the executable and returns also a relative path, possibly modified) - Fix shellchecks
21 lines
344 B
Bash
21 lines
344 B
Bash
shim_env_command() {
|
|
local shim_name="$1"
|
|
local env_cmd="${2}"
|
|
local env_args=("${@:3}")
|
|
|
|
if [ -z "$shim_name" ]; then
|
|
echo "usage: asdf env <command>"
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "$env_cmd" ]; then
|
|
env_cmd="env"
|
|
fi
|
|
|
|
shim_env() {
|
|
"$env_cmd" "${env_args[@]}"
|
|
}
|
|
|
|
with_shim_executable "$shim_name" shim_env || exit $?
|
|
}
|