File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Expand file tree Collapse file tree 2 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ bash_object.traverse-set() {
51
51
if [ " $final_value_type " = object ]; then
52
52
# TODO: test this
53
53
# shellcheck disable=SC1087
54
- if bash_object.ensure.variable_does_exist " $final_value [@] " ; then : ; else
54
+ if bash_object.ensure.variable_does_exist " $final_value " ; then : ; else
55
55
return
56
56
fi
57
57
@@ -85,7 +85,7 @@ bash_object.traverse-set() {
85
85
elif [ " $final_value_type " = array ]; then
86
86
# TODO: test this
87
87
# shellcheck disable=SC1087
88
- if bash_object.ensure.variable_does_exist " $final_value [@] " ; then : ; else
88
+ if bash_object.ensure.variable_does_exist " $final_value " ; then : ; else
89
89
return
90
90
fi
91
91
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ bash_object.ensure.variable_is_valid() {
5
5
return 0
6
6
}
7
7
8
- # @description Ensure the variable already exists. Note that the variable _must_ be sanitized before using this function
8
+ # @description Ensure the variable already exists
9
9
bash_object.ensure.variable_does_exist () {
10
10
local variable_name=" $1 "
11
11
@@ -14,14 +14,9 @@ bash_object.ensure.variable_does_exist() {
14
14
return
15
15
fi
16
16
17
- if (( BASH_VERSINFO[0 ] >= 5 )) || (( BASH_VERSINFO[0 ] == 4 && BASH_VERSINFO[1 ] >= 2 )) ; then
18
- if [[ ! -v " $variable_name " ]]; then
19
- bash_object.util.die ' ERROR_INTERNAL_MISCELLANEOUS' " Variable '$variable_name ' does not exist, but it should"
17
+ if ! declare -p " $variable_name " & > /dev/null; then
18
+ bash_object.util.die ' ERROR_INTERNAL_MISCELLANEOUS' " Variable '$variable_name ' does not exist, but it should"
20
19
return
21
- fi
22
- else
23
- # TODO
24
- :
25
20
fi
26
21
}
27
22
You can’t perform that action at this time.
0 commit comments