Skip to content

Commit 2e3aec7

Browse files
committed
- Update INI library to allow using environment variables in the INI values
1 parent a68ad34 commit 2e3aec7

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)