summaryrefslogtreecommitdiff
path: root/tools/run
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-11-28 19:11:31 -0500
committerOwen Jacobson <owen@grimoire.ca>2024-11-28 19:11:31 -0500
commit5ce6c9f6277c43caf7413cce255af7bdc947e74c (patch)
treed8976a15f1892dbc25b44c598c1323875cf67272 /tools/run
parent9da480d92c6d81139e77eb6542986cf588ae3386 (diff)
parentb715f4c6edcb1b8e8df274636b29f732bef65407 (diff)
Merge branch 'prop/fewer-run-modes'
Diffstat (limited to 'tools/run')
-rwxr-xr-xtools/run21
1 files changed, 12 insertions, 9 deletions
diff --git a/tools/run b/tools/run
index 7f43a19..88262c6 100755
--- a/tools/run
+++ b/tools/run
@@ -1,14 +1,17 @@
#!/bin/bash -e
-## tools/run [ARGS...]
+## tools/run
+##
+## Runs the service, and runs a development version of the UI, with hot
+## reloading and live code changes enabled.
-if [ -z ${PILCROW_DEV+x} ]; then
- cargo run -- "$@"
-else
- npm run dev -- & PIDS[0]=$!
- cargo run -- "$@" & PIDS[1]=$!
+PIDS=()
- trap "kill ${PIDS[*]}" SIGINT
+trap 'kill "${PIDS[@]}"' EXIT
- wait
-fi
+cargo run &
+PIDS+=($!)
+npm run dev -- --host &
+PIDS+=($!)
+
+wait "${PIDS[@]}"