Skip to content

Commit

Permalink
Merge pull request zendesk#73 from kincl/exclude-bash-4.3
Browse files Browse the repository at this point in the history
Name references are a bash 4.3 feature
  • Loading branch information
szibis authored Mar 29, 2019
2 parents 1c195b4 + 1e3468c commit 56439fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions secrets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,12 @@ enc() {
fi
}

# Name references ("declare -n" and "local -n") are a Bash 4 feature.
# Name references ("declare -n" and "local -n") are a Bash 4.3+ feature.
# For previous versions, work around using eval.
decrypt_helper() {
local yml="$1" __ymldec __dec

if [[ ${BASH_VERSINFO[0]} -lt 4 ]]
if [[ ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 3 ]]
then
local __ymldec_var='' __dec_var=''
[[ $# -ge 2 ]] && __ymldec_var=$2
Expand Down Expand Up @@ -297,7 +297,7 @@ decrypt_helper() {
fi
fi

if [[ ${BASH_VERSINFO[0]} -lt 4 ]]
if [[ ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 3 ]]
then
[[ $__ymldec_var ]] && eval $__ymldec_var="'$__ymldec'"
[[ $__dec_var ]] && eval $__dec_var="'$__dec'"
Expand Down

0 comments on commit 56439fe

Please sign in to comment.