initial commit

This commit is contained in:
khannurien
2026-09-12 09:38:07 +02:00
commit 9a39e16c1f
7 changed files with 285 additions and 0 deletions

32
dev.sh Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
# Start every dev server declared in stack.conf. Ctrl-C stops all of them.
set -euo pipefail
here="$(cd "$(dirname "$0")" && pwd)"
source "$here/stack.conf"
# The workspace root, which holds every repo of the stack as a sibling.
cd "$here/.."
pids=()
cleanup() {
trap - EXIT INT TERM
[ ${#pids[@]} -gt 0 ] && kill -TERM "${pids[@]}" 2>/dev/null
wait 2>/dev/null || true
}
trap cleanup EXIT INT TERM
for service in "${SERVICES[@]}"; do
IFS='|' read -r dir setup run <<<"$service"
[ -n "$run" ] || continue
echo "==> $dir: $run"
(cd "$dir" && exec bash -c "$run") &
pids+=($!)
done
[ ${#pids[@]} -gt 0 ] || { echo "no run command in stack.conf" >&2; exit 1; }
# Return as soon as one server exits, so cleanup stops the others rather than
# leaving half a stack running.
wait -n || true