diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-12-20 22:09:57 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2021-12-20 22:09:57 +0100 |
commit | d75ebbab2a414fe1a9a09d703a3bc7be782f1f1e (patch) | |
tree | 0de4f1c17afd6fbefbafc3a0a8a91bc85cb30355 /start | |
parent | Document testrunner syntax. (diff) | |
parent | Documentation updates for util. (diff) | |
download | calp-d75ebbab2a414fe1a9a09d703a3bc7be782f1f1e.tar.gz calp-d75ebbab2a414fe1a9a09d703a3bc7be782f1f1e.tar.xz |
Merge Javascript rewrite.
Diffstat (limited to 'start')
-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 |