-
-
Save faceair/3b2972940ca58c1152b7932c69050634 to your computer and use it in GitHub Desktop.
vgot only install binary
This file contains 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 bash | |
if [ $# = 0 ]; then | |
echo 'usage: vgot cmdpackage[@version]' | |
exit 2 | |
fi | |
d=`mktemp -d` | |
cd "$d" | |
echo 'module temp' > go.mod | |
for i; do | |
pkg=`echo $i | sed 's/@.*//'` | |
go get "$i" && | |
go install "$pkg" && | |
echo installed `go list -f '{{.ImportPath}}@{{.Module.Version}}' "$pkg"` | |
done | |
rm -r "$d" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment