Files
server/usr/libexec/nodenv/nodenv-version-origin
2026-01-07 20:52:11 +01:00

22 lines
466 B
Bash
Executable File

#!/usr/bin/env bash
# Summary: Explain how the current Node version is set
set -e
[ -n "$NODENV_DEBUG" ] && set -x
unset NODENV_VERSION_ORIGIN
OLDIFS="$IFS"
IFS=$'\n' scripts=(`nodenv-hooks version-origin`)
IFS="$OLDIFS"
for script in "${scripts[@]}"; do
source "$script"
done
if [ -n "$NODENV_VERSION_ORIGIN" ]; then
echo "$NODENV_VERSION_ORIGIN"
elif [ -n "$NODENV_VERSION" ]; then
echo "NODENV_VERSION environment variable"
else
nodenv-version-file
fi