setup-devenv.sh 918 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh
  2. # Copyright The OpenTelemetry Authors
  3. # SPDX-License-Identifier: Apache-2.0
  4. set -e
  5. # Try to autodetect the tools dir
  6. if [ "$BASH_SOURCE" != "" ]; then
  7. TOOLS_PATH=`dirname ${BASH_SOURCE[0]}`
  8. else
  9. TOOLS_PATH=`pwd`/tools
  10. fi
  11. echo "Tools directory: $TOOLS_PATH"
  12. # Install build tools if not installed yet
  13. FILE=.buildtools
  14. OS_NAME=`uname -a`
  15. if [ ! -f $FILE ]; then
  16. case "$OS_NAME" in
  17. *Darwin*) tools/setup-buildtools-mac.sh ;;
  18. *Linux*) [[ -z "$NOROOT" ]] && sudo $TOOLS_PATH/setup-buildtools.sh || echo "No root: skipping build tools installation." ;;
  19. *) echo "WARNING: unsupported OS $OS_NAME , skipping build tools installation.."
  20. esac
  21. # Assume that the build tools have been successfully installed
  22. echo > $FILE
  23. else
  24. echo Build tools have been already installed, skipping installation.
  25. fi
  26. # Configure git aliases for current session
  27. export PATH=$TOOLS_PATH:$PATH
  28. git config alias.cl '!git-cl.sh'