From ca71c045aee1eef8b485ffcde0d8fac591d894aa Mon Sep 17 00:00:00 2001 From: core Date: Sun, 14 May 2023 21:12:25 -0400 Subject: [PATCH] build assets with compiling the client --- spacetime_rs/src/commands/client.rs | 6 ++++++ spacetime_rs/src/commands/docker.rs | 7 ------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/spacetime_rs/src/commands/client.rs b/spacetime_rs/src/commands/client.rs index 46513293c1d6343688ec107fbf885a4b04fa9712..8bb3166053dc3331ff1c42c3c239ce30453478a6 100644 --- a/spacetime_rs/src/commands/client.rs +++ b/spacetime_rs/src/commands/client.rs @@ -27,6 +27,12 @@ pub fn client_protobuf(_: Vec, root: PathBuf) -> Result<(), Box, root: PathBuf) -> Result<(), Box> { + let mut config_file_writer = create_writer(&root)?; + + configure_client(&mut config_file_writer, &root)?; + + exec_ninja(&root, vec!["asset".to_string()])?; + exec("yarn", &root.join("client"), vec![])?; exec("yarn", &root.join("client"), vec!["build".to_string()]) } diff --git a/spacetime_rs/src/commands/docker.rs b/spacetime_rs/src/commands/docker.rs index a12ec7e61f2b3c8947de7f9016dae3627090fe33..7f97499c4f70b9e96897d3a72d3b1141f942d243 100644 --- a/spacetime_rs/src/commands/docker.rs +++ b/spacetime_rs/src/commands/docker.rs @@ -16,13 +16,6 @@ fn _build(img: &str, channel: &str, root: &PathBuf) -> Result<(), Box } else if img == "api" { build_api_prod(vec![], root.clone())?; } else if img == "web" { - // we need to swap out the urls - // TODO - // for now i am just adding all three to all clients - - // "s/let api_server = \"http:\\/\\/localhost:8080\";/let api_server = \"https:\\/\\/api.${1}.${2}\";/" "$SCRIPT_DIR/client/index.html" - // "s/let servers = \[\"localhost:3000\"\];/let servers = [\"${1}.${2}\"];/" "$SCRIPT_DIR/client/index.html" - let (a, b) = match channel { "stable" => ("starkingdoms", "tk"), _ => (channel, "starkingdoms.io")