From 0194d04c4920c8d6c0210618ac2c17684a8e46ef Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Fri, 22 Nov 2019 21:04:20 +0100 Subject: [PATCH] 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 --- zephyr-env.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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