summaryrefslogtreecommitdiff
path: root/functions/utilities.zsh
diff options
context:
space:
mode:
authorDominik Ritter <dritter03@googlemail.com>2018-07-19 08:44:16 +0300
committerDominik Ritter <dritter03@googlemail.com>2018-07-19 08:44:16 +0300
commit7a7b4ee13aa69bcc2006cd9b13b67732d05c48be (patch)
tree269ab95a3887052ffa5102f9739f95f4d0ece0ed /functions/utilities.zsh
parenta5d9227fcb9110bc50d28f6e70bc67c918991f0d (diff)
parent22a761208d24027a26daa947a7b4034365fefc16 (diff)
Merge remote-tracking branch 'ben/master' into add_tests
Diffstat (limited to 'functions/utilities.zsh')
-rwxr-xr-xfunctions/utilities.zsh4
1 files changed, 1 insertions, 3 deletions
diff --git a/functions/utilities.zsh b/functions/utilities.zsh
index 69fd2ec8..127007fb 100755
--- a/functions/utilities.zsh
+++ b/functions/utilities.zsh
@@ -9,9 +9,7 @@
# Exits with 0 if a variable has been previously defined (even if empty)
# Takes the name of a variable that should be checked.
function defined() {
- local varname="$1"
-
- typeset -p "$varname" > /dev/null 2>&1
+ [[ ! -z "${(tP)1}" ]]
}
# Given the name of a variable and a default value, sets the variable