summaryrefslogtreecommitdiff
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
parent9da480d92c6d81139e77eb6542986cf588ae3386 (diff)
parentb715f4c6edcb1b8e8df274636b29f732bef65407 (diff)
Merge branch 'prop/fewer-run-modes'
-rwxr-xr-xtools/run21
-rwxr-xr-xtools/run-frontend10
-rwxr-xr-xtools/run-unified9
3 files changed, 31 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[@]}"
diff --git a/tools/run-frontend b/tools/run-frontend
new file mode 100755
index 0000000..14ff49c
--- /dev/null
+++ b/tools/run-frontend
@@ -0,0 +1,10 @@
+#!/bin/bash -e
+
+## tools/run-frontend [OPTIONS…]
+##
+## Runs a development server for the Pilcrow UI. Options are passed through to
+## the `npm run dev` command. This is best combined with the `API_SERVER`
+## environment variable, to configure the development server to connect to a
+## running Pilcrow instance.
+
+exec npm run dev -- --host "$@"
diff --git a/tools/run-unified b/tools/run-unified
new file mode 100755
index 0000000..41ad1de
--- /dev/null
+++ b/tools/run-unified
@@ -0,0 +1,9 @@
+#!/bin/bash -e
+
+## tools/run-unified [OPTIONS…]
+##
+## Runs the service, with the UI unified into it (approximately as it would be
+## in a deployed configuration). Options are passed through to the `pilcrow`
+## command.
+
+exec cargo run --bin pilcrow -- "$@"