cfg/bin/spawn_gotool
Knut Ahlers 431d1be850
Add wrapper to clean install go binaries
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2019-08-04 19:08:28 +02:00

18 lines
300 B
Bash
Executable file

#!/bin/bash
set -euo pipefail
PKG=${1:-}
[[ -n ${PKG} ]] || {
echo "Usage: $0 <package>" >&2
exit 1
}
cat -s <<EOF | docker run --rm -i -e CGO_ENABLED=0 -v "$(pwd):$(pwd)" golang:alpine sh -ex -
apk --no-cache add git
go get -v ${PKG}
chown $(id -u):$(id -g) /go/bin/*
mv /go/bin/* $(pwd)
EOF