env: ignore unset var

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 <christopher.metrailler@nordicsemi.no>
This commit is contained in:
Christopher Métrailler 2019-05-17 11:24:11 +02:00 committed by Anas Nashif
parent 01a71eae3d
commit 46da745ed8

View file

@ -12,7 +12,7 @@
# #
# Note: The version of zsh need to be 5.0.6 or above. Any versions below # 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. # 5.0.6 maybe encoutner errors when sourcing this script.
if [ -n "$ZSH_VERSION" ]; then if [ -n "${ZSH_VERSION:-}" ]; then
DIR="${(%):-%N}" DIR="${(%):-%N}"
if [ $options[posixargzero] != "on" ]; then if [ $options[posixargzero] != "on" ]; then
setopt posixargzero setopt posixargzero