diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-15 15:26:06 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-05-15 15:27:46 +0200 |
commit | ab02aacdd6536ea1483b939f764c85cbe3f579e6 (patch) | |
tree | 23709ed8f8bd0c6fff3f8af48e2d641a569bfbd5 /generate-vendor.sh | |
parent | 0e4ebfa194efd6574c1ac6dc7e518b989fff5368 (diff) |
Avoid vendoring tooling as much as possible
Diffstat (limited to 'generate-vendor.sh')
-rwxr-xr-x | generate-vendor.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/generate-vendor.sh b/generate-vendor.sh new file mode 100755 index 0000000..51d0fff --- /dev/null +++ b/generate-vendor.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +echo "# This was generated by ./generate-vendor.sh" > Gopkg.lock +echo "# This was generated by ./generate-vendor.sh" > Gopkg.toml + +while read -r package; do + cat >> Gopkg.lock <<-_EOF + [[projects]] + branch = "master" + name = "$package" + revision = "$(< "$GOPATH/src/$package/.git/refs/heads/master")" + + _EOF + cat >> Gopkg.toml <<-_EOF + [[constraint]] + branch = "master" + name = "$package" + + _EOF +done < <(sed -n 's/.*"\(golang.org\/x\/[^/]\+\)\/\?.*".*/\1/p' *.go */*.go | sort | uniq) |