aboutsummaryrefslogtreecommitdiff
path: root/scripts/build.sh
diff options
context:
space:
mode:
authorAaron Buchwald <[email protected]>2020-11-13 16:57:33 -0500
committerAaron Buchwald <[email protected]>2020-11-13 16:57:33 -0500
commitc519b661358e185f9a9f09586cf7de1b17aa332f (patch)
tree338212af78fd63610f60b34eb5524aeacfe1d0dc /scripts/build.sh
parent3ac21519b323c667523034958c479d70a3af228c (diff)
Cleanup
Diffstat (limited to 'scripts/build.sh')
-rwxr-xr-xscripts/build.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/build.sh b/scripts/build.sh
new file mode 100755
index 0000000..41fab1b
--- /dev/null
+++ b/scripts/build.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+
+set -o errexit
+set -o nounset
+set -o pipefail
+
+# Set GOPATH
+GOPATH="$(go env GOPATH)"
+
+# Set default binary location
+BINARY_PATH="$GOPATH/src/github.com/ava-labs/avalanchego/build/plugins/evm"
+
+if [[ $# -eq 1 ]]; then
+ BINARY_PATH=$1
+elif [[ $# -ne 0 ]]; then
+ echo "Invalid arguments to build coreth. Requires either no arguments (default) or one arguments to specify binary location."
+ exit 1
+fi
+
+# Build Coreth, which is run as a subprocess
+echo "Building Coreth..."
+go build -o "$BINARY_PATH" "plugin/"*.go