2024-02-19 17:09:47 +00:00
|
|
|
//! Tool used to build the templated pages of the Bevy website.
|
|
|
|
|
2023-02-28 14:24:47 +00:00
|
|
|
use bitflags::bitflags;
|
|
|
|
|
|
|
|
mod examples;
|
|
|
|
mod features;
|
|
|
|
|
|
|
|
bitflags! {
|
2023-06-01 08:41:42 +00:00
|
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
2023-02-28 14:24:47 +00:00
|
|
|
struct Command: u32 {
|
|
|
|
const CHECK_MISSING = 0b00000001;
|
|
|
|
const UPDATE = 0b00000010;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bitflags! {
|
2023-06-01 08:41:42 +00:00
|
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
2023-02-28 14:24:47 +00:00
|
|
|
struct Target: u32 {
|
|
|
|
const EXAMPLES = 0b00000001;
|
|
|
|
const FEATURES = 0b00000010;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let what_to_run = match std::env::args().nth(1).as_deref() {
|
|
|
|
Some("check-missing") => Command::CHECK_MISSING,
|
|
|
|
Some("update") => Command::UPDATE,
|
|
|
|
_ => Command::all(),
|
|
|
|
};
|
|
|
|
|
|
|
|
let target = match std::env::args().nth(2).as_deref() {
|
|
|
|
Some("examples") => Target::EXAMPLES,
|
|
|
|
Some("features") => Target::FEATURES,
|
|
|
|
_ => Target::all(),
|
|
|
|
};
|
|
|
|
|
|
|
|
if target.contains(Target::EXAMPLES) {
|
|
|
|
examples::check(what_to_run);
|
|
|
|
}
|
|
|
|
if target.contains(Target::FEATURES) {
|
|
|
|
features::check(what_to_run);
|
|
|
|
}
|
|
|
|
}
|