Skip to content

Commit 4856197

Browse files
authored
Merge pull request #433 from DannyBen/update/ini-library
Update INI library to allow using environment variables in the INI values
2 parents a68ad34 + 2e3aec7 commit 4856197

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

examples/config/src/lib/ini.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ ini_load() {
4747
elif [[ $line =~ $key_regex ]]; then
4848
key="${BASH_REMATCH[1]}"
4949
value="${BASH_REMATCH[2]}"
50+
[[ $value == *\$* ]] && eval "value=\"$value\""
5051
ini["${section}${key}"]="$value"
5152
fi
5253
done <"$ini_file"

examples/ini/src/lib/ini.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ ini_load() {
4747
elif [[ $line =~ $key_regex ]]; then
4848
key="${BASH_REMATCH[1]}"
4949
value="${BASH_REMATCH[2]}"
50+
[[ $value == *\$* ]] && eval "value=\"$value\""
5051
ini["${section}${key}"]="$value"
5152
fi
5253
done <"$ini_file"

lib/bashly/libraries/ini/ini.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ ini_load() {
4747
elif [[ $line =~ $key_regex ]]; then
4848
key="${BASH_REMATCH[1]}"
4949
value="${BASH_REMATCH[2]}"
50+
[[ $value == *\$* ]] && eval "value=\"$value\""
5051
ini["${section}${key}"]="$value"
5152
fi
5253
done <"$ini_file"

0 commit comments

Comments
 (0)