use std::error::Error; use std::path::PathBuf; use crate::configure::client::configure_client; use crate::configure::create_writer; use crate::ninja::{exec, exec_ninja}; pub fn run_http(_: Vec, 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!["run".to_string(), "dev".to_string()])?; Ok(()) } pub fn client_protobuf(_: Vec, root: PathBuf) -> Result<(), Box> { exec("yarn", &root.join("client"), vec![])?; exec("yarn", &root.join("client"), vec!["protobuf".to_string()]) } pub fn build_client_prod(_: Vec, root: PathBuf) -> Result<(), Box> { exec("yarn", &root.join("client"), vec![])?; exec("yarn", &root.join("client"), vec!["build".to_string()]) }