@@ -18,14 +18,10 @@ echo "start app"
18
18
run frontend
19
19
e end: # stop app
20
20
echo "stop app"
21
- f frontend: # open frontend app
22
- run start
23
- echo "open frontend app"
24
- b backend: # attach to backend server
25
- run start
26
- echo "attach to backend server"
27
- r repl: # start shell in project environment
28
- echo "start shell environment"
21
+ t test: # run all tests or specific test [vars: name='all']
22
+ [[ -n "\$ (name)" ]] && echo "run test \$ (name)" || echo "run test all"
23
+ r repl: # start shell in project environment [vars: env='']
24
+ echo "start shell in project environment: \$ (env)"
29
25
EOF
30
26
else
31
27
cat <<EOF> Runfile
@@ -36,14 +32,11 @@ s start: end # start app
36
32
e end: # stop app
37
33
echo "stop app"
38
34
39
- f frontend : # open frontend app
40
- echo "open frontend app "
35
+ t test : # run all tests or specific test [vars: name='all']
36
+ [[ -n " \$ (name)" ]] && echo "run test \$ (name)" || echo "run test all "
41
37
42
- b backend: # attach to backend server
43
- echo "attach to backend server"
44
-
45
- r repl: # start shell
46
- echo "start shell"
38
+ r repl: # start shell in project environment [vars: env='']
39
+ echo "start shell in project environment: \$ (env)"
47
40
EOF
48
41
fi
49
42
}
@@ -107,7 +100,7 @@ function cd-to-nearest-file() { local lower='' upper='' title=''
107
100
}
108
101
109
102
function main() ( set -euo pipefail
110
- local mf='' at='' ws='' arg='' args =() cmd="" rewrite=""
103
+ local mf='' at='' ws='' rewrite="" cmd="" arg='' make_args =() cmd_args=()
111
104
112
105
# Handle various optional actions:
113
106
[[ " $* " == *' --create-runfile '* || " $* " == *' --overwrite-runfile '* ]] && \
@@ -161,8 +154,11 @@ function main() ( set -euo pipefail
161
154
if [[ -z "${cmd} " ]]
162
155
then
163
156
cmd="${arg} "
157
+ elif [[ " ${arg} " == *' -' ]]
158
+ then
159
+ make_args+=( "${arg} " )
164
160
else
165
- args +=( "${arg} " )
161
+ cmd_args +=( "${arg} " )
166
162
fi
167
163
fi
168
164
done
@@ -220,14 +216,14 @@ EOF
220
216
# Main Path : Invoke make with generated makefile and all other arguments.
221
217
if [[ " $* " == *' --dry-run-command '* ]]
222
218
then
223
- make --makefile " ${mf} " -- dry-run "${cmd} "
219
+ make_args+=( --dry-run "${cmd} " )
224
220
elif [[ -n "${cmd} " ]]
225
221
then
226
- make --makefile "${mf} " "${cmd} "
227
- else
228
- make --makefile "${mf} "
222
+ make_args+=( "${cmd} " )
229
223
fi
230
224
225
+ make --makefile "${mf} " "${make_args[@]} " -- "${cmd_args[@]} "
226
+
231
227
# Clean up temporary Makefile and exit with success:
232
228
rm "${mf} "
233
229
exit 0
0 commit comments