aboutsummaryrefslogtreecommitdiff
path: root/start
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2021-10-04 23:26:07 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2021-10-04 23:26:07 +0200
commit9aaa1814d06e68004c22292976f9cec8a7ab546b (patch)
tree8092e8fec58e23c886a923dac2d3dfb564fd5122 /start
parentAdd tsconfig.json. (diff)
downloadcalp-9aaa1814d06e68004c22292976f9cec8a7ab546b.tar.gz
calp-9aaa1814d06e68004c22292976f9cec8a7ab546b.tar.xz
add development start script.
Diffstat (limited to 'start')
-rwxr-xr-xstart28
1 files changed, 28 insertions, 0 deletions
diff --git a/start b/start
new file mode 100755
index 00000000..b8d48cc4
--- /dev/null
+++ b/start
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# Simple script for starting the HTTP server in debug mode
+# on some apropriate port.
+# Only built for development use.
+find_port() {
+ for p in "$@"; do
+ echo 2>/dev/null >/dev/tcp/localhost/$p
+ if [ $? -eq 1 ]; then
+ echo $p
+ return
+ fi
+ done
+ echo "No port available"
+ exit 1
+}
+
+port=`find_port {8080..9000}`
+
+echo "Starting on $port"
+
+$(dirname $(realpath $0))/main \
+ -o debug=#t \
+ -o edit-mode=#t \
+ --repl=$XDG_RUNTIME_DIR/calp \
+ server \
+ --port "$port" \
+ --sigusr