-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Description
Looks like the init is doing some bash-specific stuff. I ran into this trying to do some ndenv stuff in a Dockerfile RUN statement (which executes as sh -c)
root@53f25125c2a2:/# sh -c 'eval "$(ndenv init -)"'
sh: 2: eval: source: not found
sh: 5: typeset: not found
Compare this to rbenv:
root@53f25125c2a2:/# sh -c 'eval "$(rbenv init -)"'
root@53f25125c2a2:/#
Here is the rbenv init output:
root@53f25125c2a2:/# sh -c 'rbenv init -'
export PATH="/opt/rbenv/shims:${PATH}"
export RBENV_SHELL=sh
rbenv rehash 2>/dev/null
rbenv() {
local command
command="$1"
if [ "$#" -gt 0 ]; then
shift
fi
case "$command" in
rehash|shell)
eval "`rbenv "sh-$command" "$@"`";;
*)
command rbenv "$command" "$@";;
esac
}
And the ndenv init output:
root@53f25125c2a2:/# sh -c 'ndenv init -'
export PATH="/opt/ndenv/shims:${PATH}"
source "/opt/ndenv/libexec/../completions/ndenv.bash"
ndenv rehash 2>/dev/null
ndenv() {
typeset command
command="$1"
if [ "$#" -gt 0 ]; then
shift
fi
case "$command" in
rehash|shell)
eval "`ndenv "sh-$command" "$@"`";;
*)
command ndenv "$command" "$@";;
esac
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels