skipper_core/mode.rs
1/// Operating mode, read from `SKIPPER_MODE`.
2#[derive(Debug, Clone, Copy, PartialEq, Eq)]
3pub enum SkipperMode {
4 /// Default: only read the spreadsheet and skip disabled tests.
5 ReadOnly,
6 /// `SKIPPER_MODE=sync`: also add new tests to the spreadsheet (and prune stale ones).
7 Sync,
8}
9
10impl SkipperMode {
11 pub fn from_env() -> Self {
12 match std::env::var("SKIPPER_MODE").as_deref() {
13 Ok("sync") => SkipperMode::Sync,
14 _ => SkipperMode::ReadOnly,
15 }
16 }
17}