Skip to content

Commit

Permalink
Add missing phase in log directory path (#1671)
Browse files Browse the repository at this point in the history
Co-authored-by: Julian Schuler <[email protected]>
  • Loading branch information
julianschuler and julianschuler authored Mar 7, 2025
1 parent 136a9ca commit bed42cc
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions tools/pepsi/src/post_game.rs
Original file line number Diff line number Diff line change
@@ -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};
Expand All @@ -24,13 +27,23 @@ pub struct Arguments {
pub naos: Option<Vec<NaoAddress>>,
}

#[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
Expand Down Expand Up @@ -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}"))
})
Expand Down

0 comments on commit bed42cc

Please sign in to comment.