aboutsummaryrefslogtreecommitdiff
path: root/scripts/build.sh
blob: 41fab1bb6e80bf7532bf997f67b72669d0cf099d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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