xtask_lib/tasks/
install_importer.rs1use anyhow::Result;
8use clap::Args;
9
10use super::util::{cmd, workspace};
11
12#[derive(Debug, Args)]
14pub struct InstallImporterArgs {
15 #[arg(trailing_var_arg = true, allow_hyphen_values = true)]
17 pub extra: Vec<String>,
18}
19
20pub fn run(args: InstallImporterArgs) -> Result<()> {
22 let root = workspace::root()?;
23
24 let importer_path = root.join("crates/importer");
25 let importer_str = importer_path.to_string_lossy().into_owned();
26
27 let mut cargo_args = vec!["install", "--path", &importer_str];
28 let extra_refs: Vec<&str> = args.extra.iter().map(String::as_str).collect();
29 cargo_args.extend_from_slice(&extra_refs);
30
31 cmd::run("cargo", &cargo_args, &root, &[])
32}