From 2ae5784f9eee1701d29ce629d8e9b97fb2c76704 Mon Sep 17 00:00:00 2001 From: Matthew Braun Date: Tue, 27 Oct 2015 14:58:47 -0500 Subject: [PATCH] Make zephyr-env.sh work when cd is aliased Force the zephyr-env.sh script to invoke the builtin 'cd' command so that the script correctly assigns ZEPHYR_BASE, even for users who alias the 'cd' command. Aliasing 'cd' to emit a string before changing the directory is one way of putting the current working directory in the title of a terminal window. If the user's alias is executed in zephyr-env.sh, the output of 'cd' pollutes ZEPHYR_BASE, resulting in value which won't build. Signed-off-by: Matt Braun Change-Id: I8d7810d1a44ec14102d07bf35610b47d06ac1015 --- zephyr-env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zephyr-env.sh b/zephyr-env.sh index e62d8e208ca..00694665b44 100644 --- a/zephyr-env.sh +++ b/zephyr-env.sh @@ -9,7 +9,7 @@ fi # run (if it exists) by this script. # identify OS source tree root directory -export ZEPHYR_BASE=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) +export ZEPHYR_BASE=$( builtin cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) scripts_path=${ZEPHYR_BASE}/scripts echo "${PATH}" | grep -q "${scripts_path}"