diff --git a/tools/pepsi/src/post_game.rs b/tools/pepsi/src/post_game.rs index c734a63355..3cdc2dcf54 100644 --- a/tools/pepsi/src/post_game.rs +++ b/tools/pepsi/src/post_game.rs @@ -1,4 +1,7 @@ -use std::path::PathBuf; +use std::{ + fmt::{Display, Formatter, Result as FormatResult}, + path::PathBuf, +}; use argument_parsers::NaoAddress; use clap::{Args, ValueEnum}; @@ -24,13 +27,23 @@ pub struct Arguments { pub naos: Option>, } -#[derive(Clone, ValueEnum)] +#[derive(Clone, Copy, ValueEnum)] pub enum Phase { GoldenGoal, FirstHalf, SecondHalf, } +impl Display for Phase { + fn fmt(&self, f: &mut Formatter<'_>) -> FormatResult { + match self { + Phase::GoldenGoal => write!(f, "golden-goal"), + Phase::FirstHalf => write!(f, "first-half"), + Phase::SecondHalf => write!(f, "second-half"), + } + } +} + pub async fn post_game(arguments: Arguments, repository: &Repository) -> Result<()> { let config = DeployConfig::read_from_file(repository) .await @@ -61,7 +74,9 @@ pub async fn post_game(arguments: Arguments, repository: &Repository) -> Result< } progress_bar.set_message("Downloading logs..."); - let log_directory = log_directory.join(nao_address.to_string()); + let log_directory = log_directory + .join(arguments.phase.to_string()) + .join(nao_address.to_string()); nao.download_logs(log_directory, |status| { progress_bar.set_message(format!("Downloading logs: {status}")) })