go-ethereum/build/env.sh
Julian Yap 7923e2274d Build requires Go >= 1.7
Fix build error on Go >= 1.10
2018-04-30 11:52:54 -10:00

30 lines
626 B
Bash
Executable file

#!/bin/sh
set -e
if [ ! -f "build/env.sh" ]; then
echo "$0 must be run from the root of the repository."
exit 2
fi
# Create fake Go workspace if it doesn't exist yet.
workspace="$PWD/build/_workspace"
root="$PWD"
ethdir="$workspace/src/github.com/ubiq"
if [ ! -L "$ethdir/go-ubiq" ]; then
mkdir -p "$ethdir"
cd "$ethdir"
ln -s ../../../../../. go-ubiq
cd "$root"
fi
# Set up the environment to use the workspace.
GOPATH="$workspace"
export GOPATH
# Run the command inside the workspace.
cd "$ethdir/go-ubiq"
PWD="$ethdir/go-ubiq"
# Launch the arguments with the configured environment.
exec "$@"