diff --git a/_common/KeymanHosts.php b/_common/KeymanHosts.php index 651270d..0a1fc36 100644 --- a/_common/KeymanHosts.php +++ b/_common/KeymanHosts.php @@ -83,6 +83,36 @@ public function fixupHostReferences($contents) { return $contents; } + /** + * Return a Javascript snippet that defines the Keyman website hostnames for + * the current environment, which should be injected into a SCRIPT element + * near the top of the document. + */ + public function emitJavascriptConst() { + echo <<s_keyman_com", + ['api.keyman.com']: "$this->api_keyman_com", + ['help.keyman.com']: "$this->help_keyman_com", + ['keyman.com']: "$this->keyman_com", + ['keymanweb.com']: "$this->keymanweb_com", + ['downloads.keyman.com']: "$this->downloads_keyman_com", + ['blog.keyman.com']: "$this->blog_keyman_com", + ['translate.keyman.com']: "$this->translate_keyman_com", + ['r.keymanweb.com']: "$this->r_keymanweb_com", + s: "$this->s_keyman_com", + api: "$this->api_keyman_com", + help: "$this->help_keyman_com", + keyman: "$this->keyman_com", + keymanweb: "$this->keymanweb_com", + downloads: "$this->downloads_keyman_com", + blog: "$this->blog_keyman_com", + translate: "$this->translate_keyman_com", + r_keymanweb: "$this->r_keymanweb_com", + }; +END; + } + public function overrideHost($host, $value) { if(empty($this->$host)) { // If there's no value set, then we must be overriding something invalid diff --git a/_common/docker.inc.sh b/_common/docker.inc.sh index 40bd966..f52764b 100644 --- a/_common/docker.inc.sh +++ b/_common/docker.inc.sh @@ -82,6 +82,7 @@ function start_docker_container() { local CONTAINER_ID=$(get_docker_container_id $CONTAINER_NAME) if [ ! -z "$CONTAINER_ID" ]; then builder_echo green "Container $CONTAINER_ID has already been started, listening on http://$HOST:$PORT" + return 0 fi # Start the Docker container