about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2022-05-07 22:08:48 +0300
committerVika <vika@fireburn.ru>2022-05-07 22:08:48 +0300
commit974613c21479300284922e851447a51afb40057a (patch)
treee2ac0e4e273510c8e6717d0e7d3b23a7cd79791e
parentd82be2e5907a0c969697e371e38fb888f6ae22eb (diff)
downloadkittybox-974613c21479300284922e851447a51afb40057a.tar.zst
dev.sh: optional cargo-watch and systemfd support
-rwxr-xr-xdev.sh14
1 files changed, 11 insertions, 3 deletions
diff --git a/dev.sh b/dev.sh
index f00dd6c..fa39dcc 100755
--- a/dev.sh
+++ b/dev.sh
@@ -1,9 +1,17 @@
 #!/bin/sh
-export RUST_LOG="trace,retainer::cache=warn,html5ever=info,hyper=info,multipart=info,h2=warn,rustls=warn,warp=info"
+export RUST_LOG="info,kittybox=debug,retainer::cache=warn,h2=warn,rustls=warn"
 export BACKEND_URI=file://./test-dir
 export TOKEN_ENDPOINT=https://tokens.indieauth.com/token
 export AUTHORIZATION_ENDPOINT=https://indieauth.com/auth
 export COOKIE_SECRET=1234567890abcdefghijklmnopqrstuvwxyz
 #export COOKIE_SECRET_FILE=/dev/null
-
-exec systemfd --no-pid -s http::8080 -- cargo watch -x run
+if [[ "$1" == "watch" ]]; then
+	shift
+	exec systemfd --no-pid -s http::8080 -- cargo watch -x run "$@"
+elif [[ "$1" == "run" ]]; then
+	shift 1
+	exec cargo run "$@"
+else
+	echo "Usage: ./dev.sh [watch|run]"
+	exit 1
+fi