(contents: &str, path: &Path)
| 1465 | } |
| 1466 | |
| 1467 | fn ssh_config_includes_path(contents: &str, path: &Path) -> bool { |
| 1468 | let quoted = format!("\"{}\"", path.display()); |
| 1469 | let plain = path.display().to_string(); |
| 1470 | contents.lines().any(|line| { |
| 1471 | let trimmed = line.trim(); |
| 1472 | if !trimmed.starts_with("Include ") { |
| 1473 | return false; |
| 1474 | } |
| 1475 | trimmed["Include ".len()..] |
| 1476 | .split_whitespace() |
| 1477 | .any(|token| token == quoted || token == plain) |
| 1478 | }) |
| 1479 | } |
| 1480 | |
| 1481 | fn ensure_openshell_include(main_config: &Path, managed_config: &Path) -> Result<()> { |
| 1482 | if let Some(parent) = main_config.parent() { |
no test coverage detected