From 2a3cdb090fd3874bae688533142f1e45fd344cd9 Mon Sep 17 00:00:00 2001 From: Marc Finet Date: Tue, 7 Mar 2023 13:26:04 +0100 Subject: [PATCH] export: avoid error on unbound variable I the shell has `set -u` (to abort on unbound variable), sourcing export.sh currently fails when IDF_EXPORT_QUIET or IDF_PATH is not set: > /path/to/esp-idf/export.sh:16: IDF_EXPORT_QUIET: unbound variable This commit sets a default empty value to those variable, as done in 16731833fb5 (which forgot IDF_PATH as it's usually set, the other variable landed later in the file). --- export.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/export.sh b/export.sh index c10ee3f56f..41095f69d2 100644 --- a/export.sh +++ b/export.sh @@ -13,7 +13,7 @@ __realpath() { __verbose() { - [ -n "${IDF_EXPORT_QUIET}" ] && return + [ -n "${IDF_EXPORT_QUIET-}" ] && return echo "$@" } @@ -30,7 +30,7 @@ __main() { return 1 fi - if [ -z "${IDF_PATH}" ] + if [ -z "${IDF_PATH-}" ] then # IDF_PATH not set in the environment. # If using bash or zsh, try to guess IDF_PATH from script location.