File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ function display_help {
134
134
echo
135
135
tag " $BG_Y$BOLD " " Utilities"
136
136
describe_command " explain" " Output the command that would be executed by hop"
137
+ describe_command " go" " \$ @" " Start the container and run \" yarn/npm run\" {command} (default dev)"
137
138
describe_command " in" " Start a shell session within the project's code container"
138
139
echo
139
140
tag " $BG_Y$BOLD " " Aliases"
246
247
# Running Commands
247
248
#
248
249
250
+ function run_hop_command {
251
+ if [ " $EXPLAIN " == " yes" ]; then
252
+ explain hop " $@ "
253
+ else
254
+ hop " $@ "
255
+ fi
256
+ }
257
+
249
258
function run_command {
250
259
if [ " $EXPLAIN " == " yes" ]; then
251
260
explain " ${DOCKER_COMPOSE[@]} " " $@ "
@@ -305,6 +314,16 @@ if [ "$1" == "explain" ]; then
305
314
shift 1
306
315
fi
307
316
317
+ PACKAGE_MANAGER=" npm"
318
+ if [ -f " yarn.lock" ]; then
319
+ PACKAGE_MANAGER=" yarn"
320
+ fi
321
+
322
+ PACKAGE_MANAGER_RUN_CMD=(" $PACKAGE_MANAGER " )
323
+ if [ " $PACKAGE_MANAGER " == " npm" ]; then
324
+ PACKAGE_MANAGER_RUN_CMD+=(" run" )
325
+ fi
326
+
308
327
case $1 in
309
328
" app:" * |" build:" * |" db:" * |" make:" * |" migrate:" * |" queue:" * )
310
329
run_exec_command php artisan " $@ "
@@ -336,6 +355,15 @@ case $1 in
336
355
shift 1
337
356
run_exec_command php artisan migrate:fresh " $@ "
338
357
;;
358
+ " go" )
359
+ shift 1
360
+ run_hop_command up -d
361
+ if [ -z " $@ " ]; then
362
+ run_hop_command " ${PACKAGE_MANAGER_RUN_CMD[@]} " " dev"
363
+ else
364
+ run_hop_command " ${PACKAGE_MANAGER_RUN_CMD[@]} " " $@ "
365
+ fi
366
+ ;;
339
367
" migrate" )
340
368
shift 1
341
369
run_exec_command php artisan migrate " $@ "
You can’t perform that action at this time.
0 commit comments