mirror of
https://github.com/bevyengine/bevy
synced 2024-12-23 19:43:07 +00:00
9c17fc2d8d
# Objective - Currently all `ci` commands are in the `subcommands` module. This is problematic when you want to implement actually subcommands (such as `cargo r -p ci -- doc check`). - All command modules include the `_command` suffix, which is redundant. ## Solution - Move `commands` modules into root crate folder. - Merge contents of `commands/mod.rs` into `main.rs`. - Move `commands::subcommands` module into `commands` module. - Remove the `_command` suffix from all `commands::subcommands` modules.
17 lines
562 B
Rust
17 lines
562 B
Rust
use crate::{Flag, Prepare, PreparedCommand};
|
|
use argh::FromArgs;
|
|
use xshell::cmd;
|
|
|
|
/// Checks that the examples compile.
|
|
#[derive(FromArgs, Default)]
|
|
#[argh(subcommand, name = "example-check")]
|
|
pub(crate) struct ExampleCheckCommand {}
|
|
|
|
impl Prepare for ExampleCheckCommand {
|
|
fn prepare<'a>(&self, sh: &'a xshell::Shell, _flags: Flag) -> Vec<PreparedCommand<'a>> {
|
|
vec![PreparedCommand::new::<Self>(
|
|
cmd!(sh, "cargo check --workspace --examples"),
|
|
"Please fix compiler errors for examples in output above.",
|
|
)]
|
|
}
|
|
}
|