in src/main.rs [102:152]
fn try_main() -> Result<()> {
let args = Args::from_args();
let third_party_dir = args.third_party_dir.canonicalize()?;
let config = config::read_config(&third_party_dir)?;
let paths = {
let mut cell_dir = third_party_dir.clone();
if let Some(x) = &config.buck_cell_root {
cell_dir = cell_dir.join(x).canonicalize()?;
}
Paths {
manifest_path: third_party_dir.join("Cargo.toml"),
third_party_dir,
cell_dir,
}
};
log::debug!("Args = {:#?}, paths {:#?}", args, paths);
match &args.subcommand {
SubCommand::Vendor {
no_delete,
audit_sec,
no_fetch,
} => {
vendor::cargo_vendor(&config, *no_delete, *audit_sec, *no_fetch, &args, &paths)?;
}
SubCommand::Auditsec { no_fetch, autofix } => {
audit_sec::audit_sec(&config, &paths, *no_fetch, *autofix)?;
}
SubCommand::Update { .. } => {
let _ = cargo::run_cargo(
&config,
&paths.third_party_dir,
&args,
&[
"generate-lockfile",
"--manifest-path",
paths.manifest_path.to_str().unwrap(),
],
)?;
}
SubCommand::Buckify { stdout } => buckify::buckify(&config, &args, &paths, *stdout)?,
}
Ok(())
}