bevy/tools/ci/src/commands/example_check.rs
BD103 9c17fc2d8d
Restructure ci modules (#13101)
# 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.
2024-04-25 18:52:11 +00:00

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.",
)]
}
}