xtask tweaks
This commit is contained in:
@@ -22,7 +22,7 @@ pub enum Commands {
|
|||||||
CheckApiRefs,
|
CheckApiRefs,
|
||||||
Orcx {
|
Orcx {
|
||||||
#[arg(trailing_var_arg = true, num_args = 1..)]
|
#[arg(trailing_var_arg = true, num_args = 1..)]
|
||||||
subcommand: Vec<String>,
|
orcx_argv: Vec<String>,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ fn main() -> io::Result<ExitCode> {
|
|||||||
let args = Args::parse();
|
let args = Args::parse();
|
||||||
match &args.command {
|
match &args.command {
|
||||||
Commands::CheckApiRefs => check_api_refs(&args)?,
|
Commands::CheckApiRefs => check_api_refs(&args)?,
|
||||||
Commands::Orcx { subcommand } => orcx(&args, subcommand)?,
|
Commands::Orcx { orcx_argv } => orcx(&args, orcx_argv)?,
|
||||||
}
|
}
|
||||||
Ok(if EXIT_OK.load(Ordering::Relaxed) { ExitCode::SUCCESS } else { ExitCode::FAILURE })
|
Ok(if EXIT_OK.load(Ordering::Relaxed) { ExitCode::SUCCESS } else { ExitCode::FAILURE })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,14 +4,13 @@ use std::sync::atomic::Ordering;
|
|||||||
|
|
||||||
use crate::{Args, EXIT_OK};
|
use crate::{Args, EXIT_OK};
|
||||||
|
|
||||||
pub fn orcx(_args: &Args, subcommand: &[String]) -> io::Result<()> {
|
pub fn orcx(_args: &Args, argv: &[String]) -> io::Result<()> {
|
||||||
eprintln!("running orcx {}", subcommand.join(" "));
|
|
||||||
if !Command::new("cargo").args(["build", "-p", "orchid-std"]).status()?.success() {
|
if !Command::new("cargo").args(["build", "-p", "orchid-std"]).status()?.success() {
|
||||||
EXIT_OK.store(false, Ordering::Relaxed);
|
EXIT_OK.store(false, Ordering::Relaxed);
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
let status = Command::new("cargo")
|
let status = Command::new("cargo")
|
||||||
.args(["run", "-p", "orcx", "--"].into_iter().chain(subcommand.iter().map(|s| s.as_str())))
|
.args("run -p orcx --".split(' ').chain(argv.iter().map(|s| s.as_str())))
|
||||||
.status()?;
|
.status()?;
|
||||||
EXIT_OK.store(status.success(), Ordering::Relaxed);
|
EXIT_OK.store(status.success(), Ordering::Relaxed);
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
Reference in New Issue
Block a user