From 31b439ee313c9268ac338dd130390d4f7200e693 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Sun, 26 Dec 2021 22:00:20 +0100 Subject: rebrand project to workspace --- planetwars-cli/src/commands/run_match.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'planetwars-cli/src/commands/run_match.rs') diff --git a/planetwars-cli/src/commands/run_match.rs b/planetwars-cli/src/commands/run_match.rs index a5512f4..039d89a 100644 --- a/planetwars-cli/src/commands/run_match.rs +++ b/planetwars-cli/src/commands/run_match.rs @@ -7,7 +7,7 @@ use crate::match_runner; use crate::match_runner::MatchBot; use crate::match_runner::MatchConfig; use crate::resolve_bot_config; -use crate::ProjectConfig; +use crate::WorkspaceConfig; #[derive(Parser)] pub struct RunMatchCommand { @@ -19,24 +19,24 @@ pub struct RunMatchCommand { impl RunMatchCommand { pub async fn run(self) -> io::Result<()> { - let project_dir = env::current_dir().unwrap(); + let workspace_root = env::current_dir().unwrap(); - let config_path = project_dir.join("pw_project.toml"); + let config_path = workspace_root.join("pw_workspace.toml"); - let map_path = project_dir.join(format!("maps/{}.json", self.map)); + let map_path = workspace_root.join(format!("maps/{}.json", self.map)); let timestamp = chrono::Local::now().format("%Y-%m-%d-%H-%M-%S"); - let log_path = project_dir.join(format!("matches/{}.log", timestamp)); + let log_path = workspace_root.join(format!("matches/{}.log", timestamp)); let config_str = std::fs::read_to_string(config_path).unwrap(); - let project_config: ProjectConfig = toml::from_str(&config_str).unwrap(); + let workspace_config: WorkspaceConfig = toml::from_str(&config_str).unwrap(); let players = self .bots .into_iter() .map(|bot_name| { - let bot_config = project_config.bots.get(&bot_name).unwrap().clone(); - let resolved_config = resolve_bot_config(&project_dir, bot_config); + let bot_config = workspace_config.bots.get(&bot_name).unwrap().clone(); + let resolved_config = resolve_bot_config(&workspace_root, bot_config); MatchBot { name: bot_name, bot_config: resolved_config, @@ -54,7 +54,7 @@ impl RunMatchCommand { match_runner::run_match(match_config).await; println!("match completed successfully"); // TODO: don't hardcode match path. - // maybe print the match result as well? + // maybe print the match result as well? println!("wrote match log to matches/{}.log", timestamp); Ok(()) } -- cgit v1.2.3