MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / detect

Method detect

atomic-config/src/lib.rs:418–429  ·  view source on GitHub ↗

Classify the current process environment from the standard markers.

()

Source from the content-addressed store, hash-verified

416impl Environment {
417 /// Classify the current process environment from the standard markers.
418 pub fn detect() -> Self {
419 if std::env::var_os("CI").is_some() {
420 return Self::Ci;
421 }
422 if std::env::var_os("container").is_some()
423 || std::env::var_os("KUBERNETES_SERVICE_HOST").is_some()
424 || std::path::Path::new("/.dockerenv").exists()
425 {
426 return Self::Container;
427 }
428 Self::Desktop
429 }
430}
431
432/// Legacy-compatible `remotes` deserialization.

Callers 4

runMethod · 0.45
to_jsonMethod · 0.45
runMethod · 0.45

Calls 1

existsMethod · 0.45

Tested by 1