@@ 177,9 177,16 @@ build_docker() {
swap_out_server_for() {
echo "[*] Swapping out API server"
- sed -i'orig' "s/let api_server = \"http:\\/\\/localhost:8080\";/let api_server = \"https:\\/\\/api.$1.$2\";/" "$SCRIPT_DIR/client/index.html"
+ sed -i'orig' "s/let api_server = \"http:\\/\\/localhost:8080\";/let api_server = \"https:\\/\\/api.${1}.${2}\";/" "$SCRIPT_DIR/client/index.html"
echo "[*] Swapping out game server"
- sed -i "s/let servers = [\"localhost:3000\"];/let servers = [\"https:\\/\\/$1.$2\"];/" "$SCRIPT_DIR/client/index.html"
+ sed -i "s/let servers = \[\"localhost:3000\"\];/let servers = [\"${1}.${2}\"];/" "$SCRIPT_DIR/client/index.html"
+}
+
+sub_swap_server() {
+ swap_out_server_for "$1" "$2"
+}
+sub_reset_server() {
+ mv client/index.htmlorig client/index.html
}
sub_build_docker_api() {
@@ 199,7 206,7 @@ sub_build_docker_web() {
}
sub_build_docker_web_stable() {
- swap_out_server_for "stable" "starkingdoms.io"
+ swap_out_server_for "starkingdoms" "io"
build_docker "web" "stable"
mv "$SCRIPT_DIR/client/index.htmlorig" "$SCRIPT_DIR/client/index.html"
}