Skip to content

Commit

Permalink
Fixed unset variable error when using bash v3
Browse files Browse the repository at this point in the history
  • Loading branch information
mhyllander committed Oct 16, 2018
1 parent 72ad21f commit 3d99007
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions secrets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,9 @@ decrypt_helper() {

if [[ ${BASH_VERSINFO[0]} -lt 4 ]]
then
local __ymldec_var=$2
local __dec_var=$3
local __ymldec_var='' __dec_var=''
[[ $# -ge 2 ]] && __ymldec_var=$2
[[ $# -ge 3 ]] && __dec_var=$3
[[ $__dec_var ]] && eval $__dec_var=0
else
[[ $# -ge 2 ]] && local -n __ymldec=$2
Expand Down Expand Up @@ -284,6 +285,7 @@ decrypt_helper() {
[[ $__ymldec_var ]] && eval $__ymldec_var="'$__ymldec'"
[[ $__dec_var ]] && eval $__dec_var="'$__dec'"
fi
true # just so that decrypt_helper will exit with a true status on no error
}


Expand Down

0 comments on commit 3d99007

Please sign in to comment.