From 699f998f83ca76bb9ae5971cd34133a00cdf28d5 Mon Sep 17 00:00:00 2001 From: Oliver Ford Date: Fri, 15 Jul 2022 21:17:34 +0100 Subject: [PATCH] Fix invalid argument to head on macOS --- libexec/tfenv-resolve-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/tfenv-resolve-version b/libexec/tfenv-resolve-version index d9ab6ae..d0b66bc 100755 --- a/libexec/tfenv-resolve-version +++ b/libexec/tfenv-resolve-version @@ -141,7 +141,7 @@ if [[ "${version_requested}" =~ ^latest-allowed$ ]]; then version_requested="${version_num}"; ;; '~>'*) - version_without_rightmost="$(echo "${version_num}" | sed 's/\./\n./g' | head -n -1 | xargs -I@ echo -n @)"; + version_without_rightmost="$(echo "${version_num}" | rev | cut -d. -f2- | rev)"; version_requested="latest:^${version_without_rightmost}"; ;; *)