zephyr-env: don't fail unnecesarily when 'set -e'
The way the PATH modification bit was set was failing unnecesarily when the shell is being ran with -e (fail on error), which is leading to unnecessary (and dangerous) workarounds in integration scripts. So wrap it in an if sentence, so the shell doesn't bail out when the grep fails to find the scripts_path in PATH. Change-Id: Ia88a5f430e08ef4c186d11834f4cd840ccd29f7f Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
This commit is contained in:
parent
a1d7794647
commit
62ebe7200e
|
@ -52,8 +52,9 @@ export ZEPHYR_BASE=$( builtin cd "$( dirname "$DIR" )" && pwd ${MINGW_OPT})
|
||||||
|
|
||||||
scripts_path=${ZEPHYR_BASE}/scripts
|
scripts_path=${ZEPHYR_BASE}/scripts
|
||||||
scripts_path=$(echo "/$scripts_path" | sed 's/\\/\//g' | sed 's/://')
|
scripts_path=$(echo "/$scripts_path" | sed 's/\\/\//g' | sed 's/://')
|
||||||
echo "${PATH}" | grep -q "${scripts_path}"
|
if ! echo "${PATH}" | grep -q "${scripts_path}"; then
|
||||||
[ $? != 0 ] && export PATH=${scripts_path}:${PATH}
|
export PATH=${scripts_path}:${PATH}
|
||||||
|
fi
|
||||||
unset scripts_path
|
unset scripts_path
|
||||||
|
|
||||||
# enable custom environment settings
|
# enable custom environment settings
|
||||||
|
|
Loading…
Reference in a new issue