Skip to content

Commit 05e5b0e

Browse files
authored
Merge pull request #53 from DannyBen/fix/config-on-mac
Fix config regex to work on mac
2 parents e4d3c2a + 4e8cb38 commit 05e5b0e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/bashly/templates/lib/config.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ config_init() {
2121
# Usage: result=$(config_get hello)
2222
config_get() {
2323
key=$1
24-
regex="^$key\s*=\s*(.+)$"
24+
regex="^$key *= *(.+)$"
2525

2626
config_init
2727

@@ -44,7 +44,7 @@ config_set() {
4444

4545
config_init
4646

47-
regex="^($key)\s*=\s*.+$"
47+
regex="^($key) *= *.+$"
4848
output=""
4949
found_key=""
5050

@@ -71,7 +71,7 @@ config_set() {
7171
config_del() {
7272
key=$1
7373

74-
regex="^($key)\s*="
74+
regex="^($key) *="
7575
output=""
7676

7777
config_init
@@ -100,7 +100,7 @@ config_show() {
100100
# done
101101
#
102102
config_keys() {
103-
regex="^([a-zA-Z0-9_\-]+)\s*="
103+
regex="^([a-zA-Z0-9_\-]+) *="
104104

105105
config_init
106106

0 commit comments

Comments
 (0)