diff --git a/zephyr-env.sh b/zephyr-env.sh index a6d9009d00..93371416c7 100644 --- a/zephyr-env.sh +++ b/zephyr-env.sh @@ -13,20 +13,20 @@ # Note: The version of zsh need to be 5.0.6 or above. Any versions below # 5.0.6 maybe encoutner errors when sourcing this script. if [ -n "${ZSH_VERSION:-}" ]; then - DIR="${(%):-%N}" + dir="${(%):-%N}" if [ $options[posixargzero] != "on" ]; then setopt posixargzero - NAME=$(basename -- "$0") + name=$(basename -- "$0") unsetopt posixargzero else - NAME=$(basename -- "$0") + name=$(basename -- "$0") fi else - DIR="${BASH_SOURCE[0]}" - NAME=$(basename -- "$0") + dir="${BASH_SOURCE[0]}" + name=$(basename -- "$0") fi -if [ "X$NAME" "==" "Xzephyr-env.sh" ]; then +if [ "X$name" "==" "Xzephyr-env.sh" ]; then echo "Source this file (do NOT execute it!) to set the Zephyr Kernel environment." exit fi @@ -37,15 +37,15 @@ fi if uname | grep -q "MINGW"; then win_build=1 - PWD_OPT="-W" + pwd_opt="-W" else win_build=0 - PWD_OPT="" + pwd_opt="" fi # identify OS source tree root directory -export ZEPHYR_BASE=$( builtin cd "$( dirname "$DIR" )" > /dev/null && pwd ${PWD_OPT}) -unset PWD_OPT +export ZEPHYR_BASE=$( builtin cd "$( dirname "$dir" )" > /dev/null && pwd ${pwd_opt}) +unset pwd_opt scripts_path=${ZEPHYR_BASE}/scripts if [ "$win_build" -eq 1 ]; then