Skip to content

Commit

Permalink
export: avoid error on unbound variable
Browse files Browse the repository at this point in the history
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 1673183 (which forgot IDF_PATH as it's usually set, the other
variable landed later in the file).
  • Loading branch information
MarcFinetRtone committed Mar 10, 2023
1 parent acac972 commit 13e59ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ __realpath() {


__verbose() {
[ -n "${IDF_EXPORT_QUIET}" ] && return
[ -n "${IDF_EXPORT_QUIET-}" ] && return
echo "$@"
}

Expand Down Expand Up @@ -72,7 +72,7 @@ __main() {
# Since sh or dash shells can't detect script_dir correctly, check if script_dir looks like an IDF directory
is_script_dir_esp_idf=$(__is_dir_esp_idf "${script_dir}")

if [ -z "${IDF_PATH}" ]
if [ -z "${IDF_PATH-}" ]
then
# IDF_PATH not set in the environment.

Expand Down

0 comments on commit 13e59ed

Please sign in to comment.