aboutsummaryrefslogtreecommitdiff
path: root/test/formatters/installers/shfmt.bash
blob: c42b0308b46c1465874fd2788fc72ee116d7c91d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
ver="$(latest_release mvdan/sh)"

arch="$(uname -m)"
case "${arch}" in
    "x86_64")
        arch="amd64"
        ;;
    "i386")
        arch="386"
        ;;
    "aarch64")
        arch="arm64"
        ;;
    *)
        echo >&2 "unsupported architecture: ${arch}"
        exit 1
        ;;
esac

wget "https://github.com/mvdan/sh/releases/download/${ver}/shfmt_${ver}_linux_${arch}" -O /usr/local/bin/shfmt
chmod +x /usr/local/bin/shfmt