Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Bail with an error if no crates specified.
Browse files Browse the repository at this point in the history
Bug: 391657710
Test: manual
Change-Id: Idf58eff4f78c72e4641a91b47ad1fbfe84df6917
  • Loading branch information
jfgoog committed Jan 22, 2025
1 parent 2e78965 commit d42d268
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tools/external_crates/crate_tool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::{
path::PathBuf,
};

use anyhow::Result;
use anyhow::{bail, Result};
use clap::{Args, Parser, Subcommand};
use crate_tool::{
default_repo_root, maybe_build_cargo_embargo, ManagedRepo, SemverCompatibilityRule,
Expand Down Expand Up @@ -166,6 +166,9 @@ impl CrateList {
Ok(if self.all {
managed_repo.all_crate_names()?.difference(&self.exclude).cloned().collect::<Vec<_>>()
} else {
if self.crates.is_empty() {
bail!("No crates specified");
}
self.crates.clone()
})
}
Expand Down

0 comments on commit d42d268

Please sign in to comment.