Avoid vendoring tooling as much as possible

This commit is contained in:
Jason A. Donenfeld
2018-05-15 15:26:06 +02:00
parent 0e4ebfa194
commit ab02aacdd6
3 changed files with 24 additions and 32 deletions

20
generate-vendor.sh Executable file
View File

@@ -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)