#!/bin/sh set -eu escape_js() { printf '%s' "${1:-}" | sed 's/\\/\\\\/g; s/"/\\"/g' } normalize_backend_endpoint() { case "${1:-}" in */api/rivet) printf '%s/v1/rivet' "${1%/api/rivet}" ;; *) printf '%s' "${1:-}" ;; esac } cat > /srv/__foundry_runtime_config.js <