From 2a7cba00fc73ae495fc022e5a730ff71fb1cd6ee Mon Sep 17 00:00:00 2001 From: Anant Thazhemadam Date: Thu, 16 Mar 2023 14:27:57 +0530 Subject: [PATCH] feat(pre-command): set `YTT_VERSION` to latest version if not specified In case the version of ytt to be used isn't specified, simply set it to the latest version by default. --- hooks/pre-command | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hooks/pre-command b/hooks/pre-command index 6c622ae..22dca86 100644 --- a/hooks/pre-command +++ b/hooks/pre-command @@ -24,7 +24,7 @@ else fi # The version of YTT we're downloading -YTT_VERSION="${BUILDKITE_PLUGIN_YTT_VERSION}" +YTT_VERSION="${BUILDKITE_PLUGIN_YTT_VERSION:-$(curl -Ls -o /dev/null -w %{url_effective} https://github.com/carvel-dev/ytt/releases/latest | awk -F/ '{print $NF}')}" # We allow the user to override the architecture we download ARCH="${BUILDKITE_PLUGIN_YTT_ARCH:-$(uname -m)}"