aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2017-05-14 20:05:26 +0100
committerMike McQuaid2017-05-14 20:05:26 +0100
commit9c85d737add16eb574740c637d498b8610dae0ca (patch)
treeff8a7dfdedadf707d05a8d88af0e2a913dd46491
parente0ab162f82921077cfb899637fdd39e426adfc9b (diff)
downloadbrew-9c85d737add16eb574740c637d498b8610dae0ca.tar.bz2
bin/brew: don't set blank HOMEBREW_* variables.
When creating the necessary HOMEBREW_* variables ensure that they aren't set if their value would be empty.
-rwxr-xr-xbin/brew4
1 files changed, 4 insertions, 0 deletions
diff --git a/bin/brew b/bin/brew
index 20cf9564d..90e0cf3e9 100755
--- a/bin/brew
+++ b/bin/brew
@@ -49,7 +49,11 @@ HOMEBREW_LIBRARY="$HOMEBREW_REPOSITORY/Library"
for VAR in AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY BINTRAY_USER BINTRAY_KEY \
BROWSER EDITOR GIT PATH VISUAL
do
+ # Skip if variable value is empty.
+ [[ -z "${!VAR}" ]] && continue
+
VAR_NEW="HOMEBREW_${VAR}"
+ # Skip if existing HOMEBREW_* variable is set.
[[ -n "${!VAR_NEW}" ]] && continue
export "$VAR_NEW"="${!VAR}"
done