summaryrefslogtreecommitdiffhomepage
path: root/generate-vendor.sh
diff options
context:
space:
mode:
Diffstat (limited to 'generate-vendor.sh')
-rwxr-xr-xgenerate-vendor.sh20
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)