Skip to content

Commit

Permalink
_js: improve build script
Browse files Browse the repository at this point in the history
First, make it check that the 'go' command is the version we require.

Second, use 'go run' to execute gopherjs, which means the developer
doesn't need to run 'go install' first, nor pollute their $PATH with the
gopherjs version we need.
  • Loading branch information
mvdan committed Feb 1, 2019
1 parent fa07a76 commit 2985ee2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions _js/build
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/bin/sh

# If you get weird errors like 'undeclared name: CacheLinePadSize', try being
# explicit about the Go 1.11.x GOROOT, like:
#
# GOROOT=/usr/lib/go ./build
if ! go version | grep go1.11; then
echo "Go 1.11.x required to build."
exit 1
fi

export GO111MODULE=on # build in module-aware mode

gopherjs build -o index.js || exit 1
go run github.com/gopherjs/gopherjs build -o index.js || exit 1

node testmain.js || exit 1

Expand Down

0 comments on commit 2985ee2

Please sign in to comment.