diff --git a/.travis.yml b/.travis.yml index a67096f..19d22d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,6 @@ language: generic +env: + - CLICOLOR=1 matrix: include: - os: windows @@ -10,9 +12,13 @@ matrix: - os: linux dist: trusty - os: osx - osx_image: xcode11.3 + osx_image: xcode11.4 + - os: osx + osx_image: xcode11.2 # OS X 10.14 - os: osx osx_image: xcode10.3 + - os: osx + osx_image: xcode10.1 # OS X 10.13 - os: osx osx_image: xcode9.4 script: diff --git a/libexec/tfenv-list b/libexec/tfenv-list index c3897a8..8f54185 100755 --- a/libexec/tfenv-list +++ b/libexec/tfenv-list @@ -87,7 +87,8 @@ print_version () { }; log 'debug' 'Listing versions...'; -local_versions=($(ls -1 "${TFENV_ROOT}/versions" \ +local_versions=($(\find "${TFENV_ROOT}/versions" -type d -exec basename {} \; \ + | tail -n +2 \ | sort -t'.' -k 1nr,1 -k 2nr,2 -k 3nr,3)); log 'debug' "Local versions: ${local_versions[@]}"; @@ -95,4 +96,4 @@ log 'debug' "Local versions: ${local_versions[@]}"; log 'debug' 'Printing versions...'; for local_version in ${local_versions[@]}; do print_version "${local_version}"; -done; +done; \ No newline at end of file diff --git a/libexec/tfenv-use b/libexec/tfenv-use index 33817d3..dd1b0ec 100755 --- a/libexec/tfenv-use +++ b/libexec/tfenv-use @@ -72,7 +72,8 @@ declare version="${resolved%%\:*}"; declare regex="${resolved##*\:}"; log 'debug' "Searching ${TFENV_ROOT}/versions for latest version matching ${regex}"; -declare version="$(\ls "${TFENV_ROOT}/versions" \ +declare version="$(\find "${TFENV_ROOT}/versions" -type d -exec basename {} \; \ + | tail -n +2 \ | sort -t'.' -k 1nr,1 -k 2nr,2 -k 3nr,3 \ | grep -e "${regex}" \ | head -n 1 diff --git a/libexec/tfenv-version-name b/libexec/tfenv-version-name index b8923c4..ef34767 100755 --- a/libexec/tfenv-version-name +++ b/libexec/tfenv-version-name @@ -81,7 +81,8 @@ if [[ "${TFENV_VERSION}" =~ ^latest.*$ ]]; then log 'debug' "'latest' keyword does not use regex"; fi; - version="$(\ls "${TFENV_ROOT}/versions" \ + version="$(\find "${TFENV_ROOT}/versions" -type d -exec basename {} \; \ + | tail -n +2 \ | sort -t'.' -k 1nr,1 -k 2nr,2 -k 3nr,3 \ | grep -e "${regex}" \ | head -n 1)";