Created
April 21, 2021 12:23
-
-
Save vst/90e849a1d2249d4a713b98dcc53db637 to your computer and use it in GitHub Desktop.
Install Hadolint (Latest Release)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
## URL for the latest release: | |
_latest="https://api.github.com/repos/hadolint/hadolint/releases/latest" | |
## Kernel name: | |
_kernel="$(uname -s)" | |
## Architecture: | |
_arch="$(uname -m)" | |
## Target: | |
_target="${1:-/usr/local/bin/hadolint}" | |
## Download the binary to target path: | |
curl -s "${_latest}" | \ | |
grep browser_download_url | \ | |
grep "${_kernel}-${_arch}" | \ | |
cut -f 2- -d ":" | \ | |
tr -d "\"" | \ | |
wget -qi - -O "${_target}" | |
## Attend permissions: | |
chmod +x "${_target}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Install to the default target path (
/usr/local/bin/hadolint
):Install to custom target path: