asdf/lib/commands/command-env.bash

25 lines
381 B
Bash
Raw Normal View History

# -*- sh -*-
2019-01-19 19:59:27 -07:00
shim_env_command() {
local shim_name="$1"
local env_cmd="${2}"
local env_args=("${@:3}")
2019-01-19 19:59:27 -07:00
if [ -z "$shim_name" ]; then
echo "usage: asdf env <command>"
exit 1
fi
2019-01-19 19:59:27 -07:00
if [ -z "$env_cmd" ]; then
env_cmd="env"
fi
shim_env() {
"$env_cmd" "${env_args[@]}"
}
2019-01-19 19:59:27 -07:00
with_shim_executable "$shim_name" shim_env || exit $?
2019-01-19 19:59:27 -07:00
}
shim_env_command "$@"