vpython3 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/usr/bin/env bash
  2. # Copyright 2019 The Chromium Authors. All rights reserved.
  3. # Use of this source code is governed by a BSD-style license that can be
  4. # found in the LICENSE file.
  5. if [[ $VPYTHON_BYPASS == "manually managed python not supported by chrome operations" ]]
  6. then
  7. NEWARGS=()
  8. while [[ $# -gt 0 ]]
  9. do
  10. case "$1" in
  11. -vpython-tool*) # these tools all do something vpython related and quit
  12. exit 0
  13. ;;
  14. -vpython*=*) # delete any vpython-specific flag (w/ attached argument)
  15. shift
  16. ;;
  17. -vpython*) # delete any vpython-specific flag (w/ separate argument)
  18. shift
  19. shift
  20. ;;
  21. --) # stop parsing
  22. NEWARGS+=( "$@" )
  23. break
  24. ;;
  25. *) # regular arg
  26. NEWARGS+=( "$1" )
  27. shift
  28. ;;
  29. esac
  30. done
  31. exec "python3" "${NEWARGS[@]}"
  32. fi
  33. base_dir=$(dirname "$0")
  34. source "$base_dir/cipd_bin_setup.sh"
  35. cipd_bin_setup &> /dev/null
  36. if [[ $(uname -s) = MINGW* || $(uname -s) = CYGWIN* ]]; then
  37. cmd.exe //c $0.bat "$@"
  38. else
  39. exec "$base_dir/.cipd_bin/vpython3" "$@"
  40. fi