diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2021-12-28 16:09:41 +0100 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2021-12-28 16:09:41 +0100 |
commit | 6d176ac99fb096034ff5406700a7921dab48c24f (patch) | |
tree | aa6b42fa91144367f4b34c5570e036b77b093c70 /planetwars-cli/src/commands | |
parent | 51b52db78bed6585702e4bd761bb17018f5a0247 (diff) | |
download | planetwars.dev-6d176ac99fb096034ff5406700a7921dab48c24f.tar.xz planetwars.dev-6d176ac99fb096034ff5406700a7921dab48c24f.zip |
show relative path to match log
Diffstat (limited to 'planetwars-cli/src/commands')
-rw-r--r-- | planetwars-cli/src/commands/run_match.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/planetwars-cli/src/commands/run_match.rs b/planetwars-cli/src/commands/run_match.rs index 5b7a3ec..6341b31 100644 --- a/planetwars-cli/src/commands/run_match.rs +++ b/planetwars-cli/src/commands/run_match.rs @@ -16,8 +16,8 @@ pub struct RunMatchCommand { impl RunMatchCommand { pub async fn run(self) -> io::Result<()> { let workspace = Workspace::open_current_dir()?; - let map_path = workspace.maps_dir().join(format!("{}.json", &self.map)); + let map_path = workspace.map_path(&self.map); let timestamp = chrono::Local::now().format("%Y-%m-%d-%H-%M-%S"); let log_path = workspace.match_path(&format!("{}-{}", &self.map, ×tamp)); @@ -33,15 +33,14 @@ impl RunMatchCommand { let match_config = MatchConfig { map_name: self.map, map_path, - log_path, + log_path: log_path.clone(), players, }; match_runner::run_match(match_config).await; println!("match completed successfully"); - // TODO: don't hardcode match path. - // maybe print the match result as well? - println!("wrote match log to matches/{}.log", timestamp); + // TODO: maybe print the match result as well? + println!("wrote match log to {}", log_path.to_str().unwrap()); Ok(()) } } |