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 <matthew.braun@intel.com>
Change-Id: I8d7810d1a44ec14102d07bf35610b47d06ac1015
This commit is contained in:
Matthew Braun 2015-10-27 14:58:47 -05:00 committed by Anas Nashif
parent 0a58ade768
commit 2ae5784f9e

View file

@ -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}"