From 5f95120779735dbd8ae3177a4014bd6aea971b38 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Fri, 31 Mar 2017 15:26:25 -0400 Subject: [PATCH] zephyr-env.sh: only reset scripts_path on Windows The pipeline that converts scripts_path from "C:\" style to "/c/" style is only needed on Windows. Further, on Linux, it prepends an extra "/" to what gets added to PATH, since the pwd output already has a leading "/". Fix that by only making the change when we're building on Windows. Change-Id: Ied7e4491f171d82e8dee4c3a4dfdcf64adf46efd Signed-off-by: Marti Bolivar --- zephyr-env.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/zephyr-env.sh b/zephyr-env.sh index 55e7bf6c70..4d820a1ce7 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