Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tools/pepsi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pepsi"
version = "7.34.0"
version = "7.35.0"
edition.workspace = true
license.workspace = true
homepage.workspace = true
Expand Down
19 changes: 17 additions & 2 deletions tools/pepsi/src/upload.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::path::Path;

use argument_parsers::RobotAddress;
use clap::Args;
use clap::{Args, CommandFactory};
use color_eyre::{
Result,
eyre::{WrapErr, bail},
Expand Down Expand Up @@ -42,8 +42,10 @@ pub struct UploadArguments {
/// Skip the OS version check
#[arg(long)]
pub skip_os_check: bool,
/// Do not build before uploading
Comment thread
oleflb marked this conversation as resolved.
Outdated
#[arg(long)]
pub prepare: bool,
/// The Robots to upload to e.g. 20w or 10.1.24.22
#[arg(required = true)]
pub robots: Vec<RobotAddress>,
}

Expand Down Expand Up @@ -117,6 +119,15 @@ async fn upload_with_progress(
}

pub async fn upload(arguments: Arguments, repository: &Repository) -> Result<()> {
if !arguments.upload.prepare && arguments.upload.robots.is_empty() {
Comment thread
oleflb marked this conversation as resolved.
Outdated
crate::Arguments::command()
.error(
clap::error::ErrorKind::ArgumentConflict,
"Specify at least one robot to upload to, or use --prepare to build without uploading",
)
.exit();
}

let upload_directory = tempdir().wrap_err("failed to get temporary directory")?;
const BINARY_NAME: &str = "hulk_ros_z";
let hulk_binary = get_binary(arguments.build.profile(), BINARY_NAME);
Expand All @@ -138,6 +149,10 @@ pub async fn upload(arguments: Arguments, repository: &Repository) -> Result<()>
.wrap_err("failed to build")?;
}

if arguments.upload.prepare {
return Ok(());
}

repository
.populate_upload_directory(&upload_directory, &[hulk_binary])
.await
Expand Down
Loading