asdf/lib/commands/command-env.bash

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
385 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
printf "usage: asdf env <command>\n"
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 "$@"