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

Commit

Permalink
Merge "Bail with an error if no crates specified." into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Treehugger Robot authored and Gerrit Code Review committed Jan 22, 2025
2 parents c45d82f + d42d268 commit df175a4
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 df175a4

Please sign in to comment.