From 46da745ed89e7ab589e7f28f0b9cb5bca0e4d907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20M=C3=A9trailler?= Date: Fri, 17 May 2019 11:24:11 +0200 Subject: [PATCH] env: ignore unset var MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will substitute the ZSH_VERSION in case it was unset or null. No more error message will be printed when unset variables are treat as an error. Signed-off-by: Christopher Métrailler --- zephyr-env.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zephyr-env.sh b/zephyr-env.sh index f5b90d2f80..f6c7f23c5a 100644 --- a/zephyr-env.sh +++ b/zephyr-env.sh @@ -12,7 +12,7 @@ # # 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 +if [ -n "${ZSH_VERSION:-}" ]; then DIR="${(%):-%N}" if [ $options[posixargzero] != "on" ]; then setopt posixargzero