diff --git a/skills/sth/SKILL.md b/skills/sth/SKILL.md index c09ff6a..fafbba2 100644 --- a/skills/sth/SKILL.md +++ b/skills/sth/SKILL.md @@ -20,7 +20,11 @@ This script: - otherwise clones or updates `sun-praise/static-html` - builds `dist/sth` when the Go source fingerprint changes -2. Start the preview server: +2. Start the preview server **only if not already running**: + +If `STATIC_HTML_SERVER_URL` is set (e.g. the server is already deployed elsewhere), skip this step entirely. + +Otherwise start locally: ```bash bash scripts/start-server.sh [port] diff --git a/skills/sth/scripts/start-server.sh b/skills/sth/scripts/start-server.sh index 80b11bf..d5b491a 100755 --- a/skills/sth/scripts/start-server.sh +++ b/skills/sth/scripts/start-server.sh @@ -2,6 +2,12 @@ set -euo pipefail +# If an external server is already configured, skip starting a local one. +if [ -n "${STATIC_HTML_SERVER_URL:-}" ]; then + echo "STATIC_HTML_SERVER_URL is set ($STATIC_HTML_SERVER_URL) — skipping server start." >&2 + exit 0 +fi + script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" repo_dir="$("$script_dir/bootstrap-repo.sh")" host="${STATIC_HTML_HOST:-0.0.0.0}"