diff --git a/zephyr-env.sh b/zephyr-env.sh index 55e7bf6c70e..4d820a1ce70 100644 --- a/zephyr-env.sh +++ b/zephyr-env.sh @@ -35,14 +35,23 @@ fi # .zephyrrc in your home directory. It will be automatically # run (if it exists) by this script. -uname | grep -q -P "MINGW|MSYS" && PWD_OPT="-W" +if uname | grep -q -P "MINGW|MSYS"; then + win_build=1 + PWD_OPT="-W" +else + win_build=0 + PWD_OPT="" +fi # identify OS source tree root directory export ZEPHYR_BASE=$( builtin cd "$( dirname "$DIR" )" && pwd ${PWD_OPT}) unset PWD_OPT scripts_path=${ZEPHYR_BASE}/scripts -scripts_path=$(echo "/$scripts_path" | sed 's/\\/\//g' | sed 's/://') +if [ "$win_build" -eq 1 ]; then + scripts_path=$(echo "/$scripts_path" | sed 's/\\/\//g' | sed 's/://') +fi +unset win_build if ! echo "${PATH}" | grep -q "${scripts_path}"; then export PATH=${scripts_path}:${PATH} fi