1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/hack/dockerfile/install/shfmt.installer
Akihiro Suda eb484fcb67 validate: add shfmt
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-03-03 12:25:51 +09:00

11 lines
381 B
Bash
Executable file

#!/bin/sh
: "${SHFMT_COMMIT:=01725bdd30658db1fe1b9e02173c3060061fe86f}" # v3.0.2
install_shfmt() {
echo "Install shfmt version $SHFMT_COMMIT"
git clone https://github.com/mvdan/sh.git "$GOPATH/src/github.com/mvdan/sh"
cd "$GOPATH/src/github.com/mvdan/sh" || exit 1
git checkout -q "$SHFMT_COMMIT"
GO111MODULE=on go build -buildmode=pie -v -o "${PREFIX}/shfmt" ./cmd/shfmt
}