diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-10-04 23:26:07 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-10-04 23:26:07 +0200 |
commit | 9aaa1814d06e68004c22292976f9cec8a7ab546b (patch) | |
tree | 8092e8fec58e23c886a923dac2d3dfb564fd5122 | |
parent | Add tsconfig.json. (diff) | |
download | calp-9aaa1814d06e68004c22292976f9cec8a7ab546b.tar.gz calp-9aaa1814d06e68004c22292976f9cec8a7ab546b.tar.xz |
add development start script.
-rwxr-xr-x | start | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -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 |