This commit is contained in:
@@ -4,17 +4,25 @@ use std::sync::atomic::Ordering;
|
||||
|
||||
use crate::{Args, EXIT_OK};
|
||||
|
||||
pub fn orcx(_args: &Args, argv: &[String]) -> io::Result<()> {
|
||||
if !Command::new("cargo").args(["build", "-p", "orchid-std", "--quiet"]).status()?.success() {
|
||||
pub fn orcx(release: bool, _args: &Args, argv: &[String]) -> io::Result<()> {
|
||||
let mut std_build_cmd = Command::new("cargo");
|
||||
std_build_cmd.args(["build", "-p", "orchid-std", "--quiet"]);
|
||||
if release {
|
||||
std_build_cmd.arg("--release");
|
||||
}
|
||||
|
||||
if !std_build_cmd.status()?.success() {
|
||||
EXIT_OK.store(false, Ordering::Relaxed);
|
||||
return Ok(());
|
||||
}
|
||||
if !Command::new("cargo")
|
||||
.args(["run", "-p", "orcx", "--quiet", "--"])
|
||||
.args(argv)
|
||||
.status()?
|
||||
.success()
|
||||
{
|
||||
let mut run_cmd = Command::new("cargo");
|
||||
run_cmd.args(["run", "-p", "orcx", "--quiet"]);
|
||||
if release {
|
||||
run_cmd.arg("--release");
|
||||
}
|
||||
run_cmd.arg("--");
|
||||
run_cmd.args(argv);
|
||||
if !run_cmd.status()?.success() {
|
||||
EXIT_OK.store(false, Ordering::Relaxed);
|
||||
}
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user