Skip to content

Commit

Permalink
Replaced operating system definition from OSTYPE to uname. (#17)
Browse files Browse the repository at this point in the history
Replaced operating system definition from OSTYPE environment variable to uname.
  • Loading branch information
vadim-zabolotniy authored Aug 17, 2022
1 parent 44b217c commit 6a5a316
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 6a5a316

Please sign in to comment.