Classify the current process environment from the standard markers.
()
| 416 | impl 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. |