Skip to content

Commit

Permalink
rename field from manifest-paths to manifest-path
Browse files Browse the repository at this point in the history
Signed-off-by: Soc Virnyl Estela <[email protected]>
  • Loading branch information
uncomfyhalomacro committed Nov 5, 2024
1 parent cd26575 commit 4e0369c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
17 changes: 9 additions & 8 deletions cargo/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ pub struct Opts {
#[arg(
long,
short = 'C',
help = "Whether you want to manually set the root of the project. Useful with a combination \
with `--manifest-paths` or `--no-root-manifest`."
help = "Whether you want to manually set the root of the project. Useful with a combination with `--manifest-paths` or `--no-root-manifest`."
)]
pub custom_root: Option<String>,
#[arg(
Expand All @@ -68,8 +67,7 @@ pub struct Opts {
requires_if("registry", "method"),
default_value_t = false,
action = clap::ArgAction::Set,
help = "Available only if `--method` is set to registry. If a project has no root manifest, this flag is useful for those situations to set \
the manifest path manually. Useful in combination with `--manifest-paths` flag.")]
help = "Available only if `--method` is set to registry. If a project has no root manifest, this flag is useful for those situations to set the manifest path manually. Useful in combination with `--manifest-paths` flag.")]
pub no_root_manifest: bool,
#[arg(
long,
Expand All @@ -83,11 +81,14 @@ pub struct Opts {
help = "Tag some files for multi-vendor and multi-cargo_config projects"
)]
pub tag: Option<String>,
#[arg(long, help = "Other cargo manifest files to sync with vendor", visible_aliases = ["cargotoml"])]
pub manifest_paths: Vec<PathBuf>,
#[arg(long, default_value_t = true, action = clap::ArgAction::Set, help = "Update dependencies or not")]
#[arg(long, help = "Other cargo manifest files to sync with vendor or registry. Behaviour between methods changes. Consult the documentation.", visible_aliases = ["cargotoml"])]
pub manifest_path: Vec<PathBuf>,
#[arg(long, default_value_t = true, action = clap::ArgAction::Set, help = "Update dependencies or not.")]
pub update: bool,
#[arg(long, help = "Where to output vendor.tar* and cargo_config")]
#[arg(
long,
help = "Where to output vendor.tar* and cargo_config if method is vendor and registry.tar* if method is registry."
)]
pub outdir: PathBuf,
#[arg(
long,
Expand Down
2 changes: 1 addition & 1 deletion cargo/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub fn run_cargo_vendor_home_registry(setup_workdir: &Path, registry: &Opts) ->
info!("💼 Fetched dependencies.");
}
let mut lockfiles: Vec<PathBuf> = Vec::new();
for manifest in &registry.manifest_paths {
for manifest in &registry.manifest_path {
let full_manifest_path = &setup_workdir.join(manifest);
let full_manifest_path_parent = full_manifest_path.parent().unwrap_or(setup_workdir);
if full_manifest_path.is_file() {
Expand Down
2 changes: 1 addition & 1 deletion cargo/src/vendor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn run_cargo_vendor(
custom_root,
vendor_opts.vendor_specific_args.versioned_dirs,
vendor_opts.vendor_specific_args.filter,
&vendor_opts.manifest_paths,
&vendor_opts.manifest_path,
vendor_opts.update,
&vendor_opts.i_accept_the_risk,
)? {
Expand Down
8 changes: 4 additions & 4 deletions cargo/tests/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ async fn vendor_source(source: &str, filter: bool) -> io::Result<PathBuf> {
src: outfile.to_path_buf(),
compression: Compression::default(),
tag: Some(random_tag.clone()),
manifest_paths: vec![],
manifest_path: vec![],
update: true,
vendor_specific_args,
outdir: outdir.to_path_buf(),
Expand Down Expand Up @@ -148,7 +148,7 @@ async fn vendor_registry_test_with_no_root_manifest() -> io::Result<()> {
src: outfile.to_path_buf(),
compression: Compression::default(),
tag: Some(random_tag.clone()),
manifest_paths: [PathBuf::from("rust/pvsecret/Cargo.toml")].to_vec(),
manifest_path: [PathBuf::from("rust/pvsecret/Cargo.toml")].to_vec(),
update: true,
vendor_specific_args,
outdir: outdir.to_path_buf(),
Expand Down Expand Up @@ -224,7 +224,7 @@ async fn manifest_paths_with_vendor() -> io::Result<()> {
src: outfile.to_path_buf(),
compression: Compression::default(),
tag: Some(random_tag.clone()),
manifest_paths: [PathBuf::from("libflux/Cargo.toml")].to_vec(),
manifest_path: [PathBuf::from("libflux/Cargo.toml")].to_vec(),
update: true,
outdir: outdir.to_path_buf(),
color: clap::ColorChoice::Auto,
Expand Down Expand Up @@ -293,7 +293,7 @@ async fn custom_root_test() -> io::Result<()> {
src: outfile.to_path_buf(),
compression: Compression::default(),
tag: Some(random_tag.clone()),
manifest_paths: vec![],
manifest_path: vec![],
update: true,
outdir: outdir.to_path_buf(),
color: clap::ColorChoice::Auto,
Expand Down

0 comments on commit 4e0369c

Please sign in to comment.