zephyr-env.sh: Use lowercase for internal vars
ci: run_ci: Use lowercase for internal variables This makes it possible to tell at a glance which variables are internal to the script and which ones are parameters to it, which is very helpful. This convention is pretty common. See e.g. Google's shell style guide at https://google.github.io/styleguide/shell.xml#Naming_Conventions, and https://github.com/icy/bash-coding-style#naming-and-styles. It's older than those though. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
parent
ed4f3cd354
commit
0194d04c49
|
@ -13,20 +13,20 @@
|
||||||
# Note: The version of zsh need to be 5.0.6 or above. Any versions below
|
# 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.
|
# 5.0.6 maybe encoutner errors when sourcing this script.
|
||||||
if [ -n "${ZSH_VERSION:-}" ]; then
|
if [ -n "${ZSH_VERSION:-}" ]; then
|
||||||
DIR="${(%):-%N}"
|
dir="${(%):-%N}"
|
||||||
if [ $options[posixargzero] != "on" ]; then
|
if [ $options[posixargzero] != "on" ]; then
|
||||||
setopt posixargzero
|
setopt posixargzero
|
||||||
NAME=$(basename -- "$0")
|
name=$(basename -- "$0")
|
||||||
unsetopt posixargzero
|
unsetopt posixargzero
|
||||||
else
|
else
|
||||||
NAME=$(basename -- "$0")
|
name=$(basename -- "$0")
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
DIR="${BASH_SOURCE[0]}"
|
dir="${BASH_SOURCE[0]}"
|
||||||
NAME=$(basename -- "$0")
|
name=$(basename -- "$0")
|
||||||
fi
|
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."
|
echo "Source this file (do NOT execute it!) to set the Zephyr Kernel environment."
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
@ -37,15 +37,15 @@ fi
|
||||||
|
|
||||||
if uname | grep -q "MINGW"; then
|
if uname | grep -q "MINGW"; then
|
||||||
win_build=1
|
win_build=1
|
||||||
PWD_OPT="-W"
|
pwd_opt="-W"
|
||||||
else
|
else
|
||||||
win_build=0
|
win_build=0
|
||||||
PWD_OPT=""
|
pwd_opt=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# identify OS source tree root directory
|
# identify OS source tree root directory
|
||||||
export ZEPHYR_BASE=$( builtin cd "$( dirname "$DIR" )" > /dev/null && pwd ${PWD_OPT})
|
export ZEPHYR_BASE=$( builtin cd "$( dirname "$dir" )" > /dev/null && pwd ${pwd_opt})
|
||||||
unset PWD_OPT
|
unset pwd_opt
|
||||||
|
|
||||||
scripts_path=${ZEPHYR_BASE}/scripts
|
scripts_path=${ZEPHYR_BASE}/scripts
|
||||||
if [ "$win_build" -eq 1 ]; then
|
if [ "$win_build" -eq 1 ]; then
|
||||||
|
|
Loading…
Reference in a new issue