Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bevyengine
GitHub Repository: bevyengine/bevy
Path: blob/main/tools/build-templated-pages/src/main.rs
6595 views
1
//! Tool used to build the templated pages of the Bevy website.
2
3
use bitflags::bitflags;
4
5
mod examples;
6
mod features;
7
8
bitflags! {
9
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
10
struct Command: u32 {
11
const CHECK_MISSING = 0b00000001;
12
const UPDATE = 0b00000010;
13
}
14
}
15
16
bitflags! {
17
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
18
struct Target: u32 {
19
const EXAMPLES = 0b00000001;
20
const FEATURES = 0b00000010;
21
}
22
}
23
24
fn main() {
25
let what_to_run = match std::env::args().nth(1).as_deref() {
26
Some("check-missing") => Command::CHECK_MISSING,
27
Some("update") => Command::UPDATE,
28
_ => Command::all(),
29
};
30
31
let target = match std::env::args().nth(2).as_deref() {
32
Some("examples") => Target::EXAMPLES,
33
Some("features") => Target::FEATURES,
34
_ => Target::all(),
35
};
36
37
if target.contains(Target::EXAMPLES) {
38
examples::check(what_to_run);
39
}
40
if target.contains(Target::FEATURES) {
41
features::check(what_to_run);
42
}
43
}
44
45