Skip to content

Commit 2bab52f

Browse files
committed
bugfix: inadvertent replacement of MAKEFILE_LIST var breaking tasks list
1 parent 6eed448 commit 2bab52f

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Runfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ stop: # stop app
88
b build: lint # build app for environment [vars: env]
99
[[ -n $(env) ]] && echo "buiding app for $(env)" || echo "error: missing env"
1010

11-
t test: build # run all tests or specific tests [vars: name1, name2, etc.]
11+
t test: # run all tests or specific tests [vars: name1, name2, etc.]
12+
run build env=test
1213
[[ -n $(@) ]] && echo "running tests $(@)" || echo "running all tests"
1314

1415
l lint: # lint all files or specific file [vars: file]

runfile.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,10 @@ EOF
184184
if ! (( ${#cmd_args[@]} ))
185185
then
186186
# Case where no named arguments were provided: replace $(abc) $(xyz) etc.
187-
buffer="$( echo "${buffer}" | sed -E 's!\$\([a-zA-Z_][a-zA-Z0-9_]*\)!``!g' )"
187+
# Note: There must be at least one lowercase letter [a-z] in these matches,
188+
# because otherwise we'd replace built in Make vars like $(MAKEFILE_LIST)
189+
# which we want to leave alone.
190+
buffer="$( echo "${buffer}" | sed -E 's!\$\([a-zA-Z0-9_]*[a-z][a-zA-Z0-9_]*\)!``!g' )"
188191
fi
189192
if ! (( ${#pos_args[@]} ))
190193
then
@@ -247,8 +250,12 @@ EOF
247250
then
248251
make_args+=( "${cmd}" )
249252
fi
253+
if (( ${#cmd_args[@]} ))
254+
then
255+
make_args+=( -- "${cmd_args[@]}" )
256+
fi
250257
251-
make --makefile "${makefile}" "${make_args[@]}" -- "${cmd_args[@]}"
258+
make --makefile "${makefile}" "${make_args[@]}"
252259
253260
# Clean up temporary Makefile and exit with success:
254261
rm "${makefile}"

0 commit comments

Comments
 (0)