@gomnitrix Generally looks good.
Would you like to port the logic in xtask/src/main.rs? Then we can avoid depending on Shell/PowerShell knowledge and you may want to learn Rust and leverage the Rust (clap-rs, cli) ecosystem for more.
You can start with the following command and perhaps add a new bootstrap subcommand.
|
#[derive(Subcommand)] |
|
enum SubCommand { |
|
#[clap(about = "Compile workspace packages.")] |
|
Build(CommandBuild), |
|
#[clap(about = "Run format and clippy checks.")] |
|
Lint(CommandLint), |
|
#[clap(about = "Run unit tests.")] |
|
Test(CommandTest), |
|
} |
|
|
|
#[derive(Parser)] |
|
struct CommandBuild { |
|
#[arg(long, help = "Assert that `Cargo.lock` will remain unchanged.")] |
|
locked: bool, |
|
} |
|
|
|
impl CommandBuild { |
|
fn run(self) { |
|
run_command(make_build_cmd(self.locked)); |
|
} |
|
} |
Originally posted by @tisonkun in #5 (comment)
@gomnitrix Generally looks good.
Would you like to port the logic in
xtask/src/main.rs? Then we can avoid depending on Shell/PowerShell knowledge and you may want to learn Rust and leverage the Rust (clap-rs, cli) ecosystem for more.You can start with the following command and perhaps add a new
bootstrapsubcommand.template/xtask/src/main.rs
Lines 38 to 58 in 2c696c1
Originally posted by @tisonkun in #5 (comment)