env.sh 713 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. set -e
  3. if [ ! -f "build/env.sh" ]; then
  4. echo "$0 must be run from the root of the repository."
  5. exit 2
  6. fi
  7. # Create fake Go workspace if it doesn't exist yet.
  8. workspace="$PWD/build/_workspace"
  9. root="$PWD"
  10. ethdir="$workspace/src/github.com/ethereum"
  11. if [ ! -L "$ethdir/go-ethereum" ]; then
  12. mkdir -p "$ethdir"
  13. cd "$ethdir"
  14. ln -s ../../../../../. go-ethereum
  15. cd "$root"
  16. fi
  17. # Set up the environment to use the workspace.
  18. # Also add Godeps workspace so we build using canned dependencies.
  19. GOPATH="$workspace"
  20. export GOPATH
  21. # Run the command inside the workspace.
  22. cd "$ethdir/go-ethereum"
  23. PWD="$ethdir/go-ethereum"
  24. # Launch the arguments with the configured environment.
  25. exec "$@"