Skip to content

Commit

Permalink
Make zephyr-env.sh work when cd is aliased
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mxbrauni authored and nashif committed Feb 6, 2016
1 parent 0a58ade commit 2ae5784
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zephyr-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 2ae5784

Please sign in to comment.