Skip to content

Commit

Permalink
zephyr-env.sh: Use lowercase for internal vars
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ulfalizer authored and andrewboie committed Dec 10, 2019
1 parent ed4f3cd commit 0194d04
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions zephyr-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 0194d04

Please sign in to comment.