Skip to content

Commit

Permalink
Merge pull request tfutils#264 from hargut/master
Browse files Browse the repository at this point in the history
add trailing slash for find command on list & use; allows versions di…
  • Loading branch information
Zordrak authored Aug 14, 2021
2 parents a3d5f46 + 4a84d2f commit 4e75af3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libexec/tfenv-list
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ print_version () {
};

log 'debug' 'Listing versions...';
local_versions=($(\find "${TFENV_CONFIG_DIR}/versions" -type d -exec basename {} \; \
local_versions=($(\find "${TFENV_CONFIG_DIR}/versions/" -type d -exec basename {} \; \
| tail -n +2 \
| sort -t'.' -k 1nr,1 -k 2nr,2 -k 3nr,3));

Expand Down
4 changes: 2 additions & 2 deletions libexec/tfenv-use
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ declare resolved="$(tfenv-resolve-version ${requested_arg})";
declare version="${resolved%%\:*}";
declare regex="${resolved##*\:}";

log 'debug' "Searching ${TFENV_CONFIG_DIR}/versions for latest version matching ${regex}";
declare version="$(\find "${TFENV_CONFIG_DIR}/versions" -type d -exec basename {} \; \
log 'debug' "Searching ${TFENV_CONFIG_DIR}/versions/ for latest version matching ${regex}";
declare version="$(\find "${TFENV_CONFIG_DIR}/versions/" -type d -exec basename {} \; \
| tail -n +2 \
| sort -t'.' -k 1nr,1 -k 2nr,2 -k 3nr,3 \
| grep -e "${regex}" \
Expand Down
2 changes: 1 addition & 1 deletion libexec/tfenv-version-name
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ if [[ "${TFENV_VERSION}" =~ ^latest.*$ ]]; then
log 'debug' "'latest' keyword does not use regex";
fi;

version="$(\find "${TFENV_CONFIG_DIR}/versions" -type d -exec basename {} \; \
version="$(\find "${TFENV_CONFIG_DIR}/versions/" -type d -exec basename {} \; \
| tail -n +2 \
| sort -t'.' -k 1nr,1 -k 2nr,2 -k 3nr,3 \
| grep -e "${regex}" \
Expand Down

0 comments on commit 4e75af3

Please sign in to comment.