github.com/aquanetwork/aquachain@v1.7.8/build/env.sh (about) 1 #!/bin/sh 2 3 set -e 4 5 if [ ! -f "build/env.sh" ]; then 6 echo "$0 must be run from the root of the repository." 7 exit 2 8 fi 9 10 # Create fake Go workspace if it doesn't exist yet. 11 workspace="/tmp/aqua/_workspace" 12 root="$PWD" 13 aquasrc="$workspace/src/gitlab.com/aquachain" 14 mkdir -p $aquasrc 15 if [ ! -L "$aquasrc/aquachain" ]; then 16 echo "creating workspace: $aquasrc/aquachain" 17 mkdir -p "$aquasrc" 18 cd "$aquasrc" 19 ln -s $root aquachain 20 cd "$root" 21 fi 22 23 # Set up the environment to use the workspace. 24 GOPATH="$workspace" 25 export GOPATH 26 27 # Run the command inside the workspace. 28 cd "$aquasrc/aquachain" 29 PWD="$aquasrc/aquachain" 30 31 # Launch the arguments with the configured environment. 32 exec "$@"