From 3c520be3ad06793a48c755921aefc17833ba0481 Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Fri, 22 Nov 2024 18:26:46 -0500 Subject: Dedicate `tools/run` to running the development server(s). * It now _always_ runs both the backend and the frontend. * The frontend is now _always_ exposed on both `localhost` and on the machine's local network interfaces. The role of running a consolidated server is now handled by `cargo run` (this has been possible since e7d4b6d7ddbcd0128e47476e6cd1d824a1929f3c anyways). --- tools/run | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'tools/run') 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[@]}" -- cgit v1.2.3