diff --git a/libexec/Renv b/libexec/Renv index 873fdb81d8..b18fceb7ed 100755 --- a/libexec/Renv +++ b/libexec/Renv @@ -60,7 +60,7 @@ shopt -u nullglob command="$1" case "$command" in "" | "-h" | "--help" ) - echo -e "Renv 0.3.0\n$(Renv-help)" >&2 + echo -e "Renv 0.3.1\n$(Renv-help)" >&2 ;; * ) command_path="$(command -v "Renv-$command" || true)" diff --git a/libexec/Renv-version-name b/libexec/Renv-version-name index d65a04c3d8..73314f53e0 100755 --- a/libexec/Renv-version-name +++ b/libexec/Renv-version-name @@ -7,6 +7,13 @@ if [ -z "$RENV_VERSION" ]; then RENV_VERSION="$(Renv-version-file-read "$RENV_VERSION_FILE" || true)" fi +OLDIFS="$IFS" +IFS=$'\n' scripts=(`Renv-hooks version-name`) +IFS="$OLDIFS" +for script in "${scripts[@]}"; do + source "$script" +done + if [ -z "$RENV_VERSION" ] || [ "$RENV_VERSION" = "system" ]; then echo "system" exit diff --git a/libexec/Renv-version-origin b/libexec/Renv-version-origin index fd0f2f1eac..6063b25d4e 100755 --- a/libexec/Renv-version-origin +++ b/libexec/Renv-version-origin @@ -2,7 +2,18 @@ set -e [ -n "$RENV_DEBUG" ] && set -x -if [ -n "$RENV_VERSION" ]; then +unset RENV_VERSION_ORIGIN + +OLDIFS="$IFS" +IFS=$'\n' scripts=(`Renv-hooks version-origin`) +IFS="$OLDIFS" +for script in "${scripts[@]}"; do + source "$script" +done + +if [ -n "$RENV_VERSION_ORIGIN" ]; then + echo "$RENV_VERSION_ORIGIN" +elif [ -n "$RENV_VERSION" ]; then echo "RENV_VERSION environment variable" else Renv-version-file