From 6a5a316dab5809554c378f05285b7caeeb7a39dc Mon Sep 17 00:00:00 2001 From: vadim-zabolotniy <34000376+vadim-zabolotniy@users.noreply.github.com> Date: Thu, 18 Aug 2022 01:04:09 +0300 Subject: [PATCH] Replaced operating system definition from OSTYPE to uname. (#17) Replaced operating system definition from OSTYPE environment variable to uname. --- plugin.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin.yaml b/plugin.yaml index 159bcad..4c0ed76 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -21,10 +21,11 @@ command: "$HELM_PLUGIN_DIR/release.sh" hooks: install: | VERSION=$(curl --silent "https://api.github.com/repos/mikefarah/yq/releases/latest" | jq -r .tag_name) - case "$OSTYPE" in + OS="$(uname | tr '[:upper:]' '[:lower:]')" + case $OS in darwin*) BINARY="yq_darwin_amd64" ;; linux*) BINARY="yq_linux_amd64" ;; - *) printf '%s\n' "Unsupported operating system detected while installing yq." >&2;exit 1 ;; + *) printf '%s\n' "Unsupported operating system($OS) detected while installing yq." >&2;exit 1 ;; esac curl -L https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY} -o $HELM_PLUGIN_DIR/lib/yq; chmod +x $HELM_PLUGIN_DIR/lib/yq;