Skip to content

Commit c5758de

Browse files
committed
fix: Regex works with tabs
1 parent 5fa4329 commit c5758de

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ is an empty string
183183

184184
#### Variables set
185185

186-
* **REPLY** (string): The full path to the directory
186+
* **directory** (string): The full path to the directory
187187

188188
### core.init()
189189

pkg/src/public/bash-core.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ core.should_output_color() {
362362
# @description Gets information from a particular package. If the key does not exist, then the value
363363
# is an empty string
364364
# @arg $1 string The `$BASALT_PACKAGE_DIR` of the caller
365-
# @set REPLY string The full path to the directory
365+
# @set directory string The full path to the directory
366366
core.get_package_info() {
367367
unset REPLY; REPLY=
368368
local basalt_package_dir="$1"
@@ -374,7 +374,7 @@ core.get_package_info() {
374374
core.print_error "File '$toml_file' could not be found"
375375
fi
376376

377-
local regex="^[ \t]*${key_name}[ \t]*=[ \t]*['\"](.*)['\"]"
377+
local regex=$'^[ \t]*'"${key_name}"$'[ \t]*=[ \t]*[\'"](.*)[\'"]'
378378
while IFS= read -r line || [ -n "$line" ]; do
379379
if [[ $line =~ $regex ]]; then
380380
REPLY=${BASH_REMATCH[1]}

0 commit comments

Comments
 (0)