Skip to content

Commit

Permalink
Allow arbitrary Go commands for go_mod.sh.
Browse files Browse the repository at this point in the history
  • Loading branch information
amscanne committed Jul 9, 2020
1 parent 60e1958 commit 2f24ab3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/go_mod.sh → tools/go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
set -eo pipefail

# Build the :gopath target.
bazel build //:gopath
make build TARGETS=":gopath"
declare -r gopathdir="bazel-bin/gopath/src/gvisor.dev/gvisor/"

# Copy go.mod and execute the command.
cp -a go.mod go.sum "${gopathdir}"
(cd "${gopathdir}" && go mod "$@")
(cd "${gopathdir}" && go "$@")
cp -a "${gopathdir}/go.mod" "${gopathdir}/go.sum" .

# Cleanup the WORKSPACE file.
bazel run //:gazelle -- update-repos -from_file=go.mod
make run TARGETS=":gazelle" ARGS="update-repos -from_file=go.mod"

0 comments on commit 2f24ab3

Please sign in to comment.