Viewing:
LIGHTPANDA="${LIGHTPANDA:-lightpanda}" PAD_DB="$HOME/pad-if.db" PAD_SIGNUP_CODE="${PAD_SIGNUP_CODE:-asdf}" PAD_PORT="${PAD_PORT:-8001}" prior_test_server="$(lsof -i:$PAD_PORT -t)" rm -f "$PAD_DB" if [ "$prior_test_server" != '' ]; then echo 'killing prior test server' kill -9 "$prior_test_server" fi PAD_DB="$PAD_DB" PAD_PORT="$PAD_PORT" PAD_SIGNUP_CODE="$PAD_SIGNUP_CODE" zig build run & server_pid="$!" await_server() { local status_code='0' while [ "$status_code" != '200' ]; do status_code="$(curl -s -o /dev/null -w "%{http_code}" http://localhost:$PAD_PORT/login)" counter=$((counter + 1)) if [ "$counter" -gt '10' ]; then echo 'did not find server' exit 1 elif ! kill -0 "$server_pid" &> /dev/null; then echo "server process exited" exit 1 fi echo "status_code is currently $status_code" sleep 1 done } await_server LIGHTPANDA_DISABLE_TELEMETRY=true $LIGHTPANDA agent ./if.js