Browse Source

misc: Emit warning on commands if jenv not initialised/loaded

pull/433/head
andrewflbarnes 2 years ago
parent
commit
d219b9a4fc
No known key found for this signature in database
  1. 18
      libexec/jenv

18
libexec/jenv

@ -99,9 +99,25 @@ shopt -u nullglob @@ -99,9 +99,25 @@ shopt -u nullglob
command="$1"
case "$command" in
"completions" | "init" | "doctor" )
;;
*)
if [[ "$JENV_LOADED" != "1" ]]
then
{
echo "Warning‘: jenv has not been initialised in the current shell, run"
echo ' eval "$(jenv init -)"'
echo
} >&2
fi
;;
esac
case "$command" in
"" | "-h" | "--help" )
echo -e "$(jenv --version)\n$(jenv-help)" >&2
echo -e "$(jenv---version)\n$(jenv-help)" >&2
;;
* )
command_path="$(command -v "jenv-$command" || true)"

Loading…
Cancel
Save