diff --git a/fetch b/fetch index 3227b888b2..ca617e50c3 100755 --- a/fetch +++ b/fetch @@ -9,16 +9,13 @@ base_dir=$(dirname "$0") # standalone, but allow other PATH manipulations to take priority. PATH=$PATH:$base_dir -# MINGW will equal 0 if we're running on Windows under MinGW. -MINGW=$(uname -s | grep MINGW > /dev/null; echo $?) - if [[ $GCLIENT_PY3 == 1 ]]; then # Explicitly run on Python 3 PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/fetch.py" "$@" elif [[ $GCLIENT_PY3 == 0 ]]; then # Explicitly run on Python 2 PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/fetch.py" "$@" -elif [[ $MINGW = 0 ]]; then +elif [[ $(uname -s) = MINGW* || $(uname -s) = CYGWIN* ]]; then # Run on Python 2 on Windows for now, allows default to be flipped. PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/fetch.py" "$@" else diff --git a/gclient b/gclient index 8937334457..003e190bbb 100755 --- a/gclient +++ b/gclient @@ -26,16 +26,13 @@ fi # standalone, but allow other PATH manipulations to take priority. PATH=$PATH:$base_dir -# MINGW will equal 0 if we're running on Windows under MinGW. -MINGW=$(uname -s | grep MINGW > /dev/null; echo $?) - if [[ $GCLIENT_PY3 == 1 ]]; then # Explicitly run on Python 3 PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/gclient.py" "$@" elif [[ $GCLIENT_PY3 == 0 ]]; then # Explicitly run on Python 2 PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/gclient.py" "$@" -elif [[ $MINGW = 0 ]]; then +elif [[ $(uname -s) = MINGW* || $(uname -s) = CYGWIN* ]]; then # Run on Python 2 on Windows for now, allows default to be flipped. PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/gclient.py" "$@" else diff --git a/python_runner.sh b/python_runner.sh index 50deb20de2..60267281f6 100755 --- a/python_runner.sh +++ b/python_runner.sh @@ -48,16 +48,13 @@ SCRIPT="${SCRIPT-${BASENAME//-/_}.py}" # standalone, but allow other PATH manipulations to take priority. PATH=$PATH:$DEPOT_TOOLS -# MINGW will equal 0 if we're running on Windows under MinGW. -MINGW=$(uname -s | grep MINGW > /dev/null; echo $?) - if [[ $GCLIENT_PY3 = 1 ]]; then # Explicitly run on Python 3 vpython3 "$DEPOT_TOOLS/$SCRIPT" "$@" elif [[ $GCLIENT_PY3 = 0 ]]; then # Explicitly run on Python 2 vpython "$DEPOT_TOOLS/$SCRIPT" "$@" -elif [[ $MINGW = 0 ]]; then +elif [[ $(uname -s) = MINGW* || $(uname -s) = CYGWIN* ]]; then # Run on Python 2 on Windows for now, allows default to be flipped. vpython "$DEPOT_TOOLS/$SCRIPT" "$@" else diff --git a/roll-dep b/roll-dep index 7016ee38df..cde993eda4 100755 --- a/roll-dep +++ b/roll-dep @@ -9,16 +9,13 @@ base_dir=$(dirname "$0") # standalone, but allow other PATH manipulations to take priority. PATH=$PATH:$base_dir -# MINGW will equal 0 if we're running on Windows under MinGW. -MINGW=$(uname -s | grep MINGW > /dev/null; echo $?) - if [[ $GCLIENT_PY3 = 1 ]]; then # Explicitly run on Python 3 PYTHONDONTWRITEBYTECODE=1 exec vpython3 "$base_dir/roll_dep.py" "$@" elif [[ $GCLIENT_PY3 = 0 ]]; then # Explicitly run on Python 2 PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/roll_dep.py" "$@" -elif [[ $MINGW = 0 ]]; then +elif [[ $(uname -s) = MINGW* || $(uname -s) = CYGWIN* ]]; then # Run on Python 2 on Windows for now, allows default to be flipped. PYTHONDONTWRITEBYTECODE=1 exec vpython "$base_dir/roll_dep.py" "$@" else diff --git a/vpython3 b/vpython3 index b8a8334a6a..91a0625170 100755 --- a/vpython3 +++ b/vpython3 @@ -39,12 +39,9 @@ base_dir=$(dirname "$0") source "$base_dir/cipd_bin_setup.sh" cipd_bin_setup &> /dev/null -# MINGW will equal 0 if we're running on Windows under MinGW. -MINGW=$(uname -s | grep MINGW > /dev/null; echo $?) - # If Python bootstrapping is not disabled, make sure Python has been # bootstrapped and add it to the front of PATH. -if [[ $MINGW = 0 ]]; then +if [[ $(uname -s) = MINGW* || $(uname -s) = CYGWIN* ]]; then cmd.exe //c $0.bat "$@" elif [[ $DEPOT_TOOLS_BOOTSTRAP_PYTHON3 != 0 ]]; then if [[ ! -e "$base_dir/python3_bin_reldir.txt" ]]; then