Make OSDK wrapped commands unified and fix make docs

This commit is contained in:
Zhang Junyang
2024-03-06 17:05:54 +08:00
committed by Tate, Hongliang Tian
parent 132d36bf20
commit 160cb9cdb5
5 changed files with 45 additions and 75 deletions

View File

@ -3,14 +3,25 @@
//! This module contains subcommands of cargo-osdk.
mod build;
mod check;
mod clippy;
mod new;
mod run;
mod test;
mod util;
pub use self::{
build::execute_build_command, check::execute_check_command, clippy::execute_clippy_command,
new::execute_new_command, run::execute_run_command, test::execute_test_command,
build::execute_build_command, new::execute_new_command, run::execute_run_command,
test::execute_test_command,
};
/// Execute the forwarded cargo command with args containing the subcommand and its arguments.
pub fn execute_forwarded_command(subcommand: &str, args: &Vec<String>) -> ! {
let mut cargo = util::cargo();
cargo
.arg(subcommand)
.args(util::COMMON_CARGO_ARGS)
.arg("--target")
.arg("x86_64-unknown-none")
.args(args);
let status = cargo.status().expect("Failed to execute cargo");
std::process::exit(status.code().unwrap_or(1));
}