From 4371a29332b3f1b7631f977c02e6a8196fcea0ea Mon Sep 17 00:00:00 2001 From: Gerard Vivancos Date: Tue, 23 Feb 2021 12:52:22 +0100 Subject: [PATCH 1/2] Fail if resolve does not succeed --- libexec/tfenv-install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libexec/tfenv-install b/libexec/tfenv-install index 187a7c7..3f1da5a 100755 --- a/libexec/tfenv-install +++ b/libexec/tfenv-install @@ -63,7 +63,8 @@ done; declare requested="${1:-""}"; log debug "Resolving version with: tfenv-resolve-version ${requested}"; -declare resolved="$(tfenv-resolve-version ${requested})"; +declare resolved; +resolved="$(tfenv-resolve-version ${requested})" || early_death "Failed to resolve ${requested} version"; declare version="${resolved%%\:*}"; declare regex="${resolved##*\:}"; From 734aea587294652c55e8222f9f24f4b8280b17b2 Mon Sep 17 00:00:00 2001 From: Gerard Vivancos Date: Sat, 5 Jun 2021 08:58:14 +0200 Subject: [PATCH 2/2] Use the logging library --- libexec/tfenv-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/tfenv-install b/libexec/tfenv-install index 1251d9e..8fe7971 100755 --- a/libexec/tfenv-install +++ b/libexec/tfenv-install @@ -64,7 +64,7 @@ declare requested="${1:-""}"; log debug "Resolving version with: tfenv-resolve-version ${requested}"; declare resolved; -resolved="$(tfenv-resolve-version ${requested})" || early_death "Failed to resolve ${requested} version"; +resolved="$(tfenv-resolve-version ${requested})" || log 'error' "Failed to resolve ${requested} version"; declare version="${resolved%%\:*}"; declare regex="${resolved##*\:}";