github.com/elastos/Elastos.ELA.SideChain.ETH@v0.2.2/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="$PWD/build/_workspace"
    12  root="$PWD"
    13  ethdir="$workspace/src/github.com/elastos"
    14  if [ ! -L "$ethdir/Elastos.ELA.SideChain.ESC" ]; then
    15      mkdir -p "$ethdir"
    16      cd "$ethdir"
    17      ln -s ../../../../../. Elastos.ELA.SideChain.ESC
    18      cd "$root"
    19  fi
    20  
    21  # Set up the environment to use the workspace.
    22  GOPATH="$workspace"
    23  export GOPATH
    24  
    25  # Run the command inside the workspace.
    26  cd "$ethdir/Elastos.ELA.SideChain.ESC"
    27  PWD="$ethdir/Elastos.ELA.SideChain.ESC"
    28  
    29  # Launch the arguments with the configured environment.
    30  exec "$@"