summaryrefslogtreecommitdiff
path: root/tools/run
diff options
context:
space:
mode:
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..a9d52ee 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[@]}"