Skip to content

Bootstrap script as xtask subcommand #7

@tisonkun

Description

@tisonkun

@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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions