(path: &Path)
| 239 | } |
| 240 | |
| 241 | fn is_executable_file(path: &Path) -> bool { |
| 242 | if !path.is_file() { |
| 243 | return false; |
| 244 | } |
| 245 | |
| 246 | #[cfg(unix)] |
| 247 | { |
| 248 | use std::os::unix::fs::PermissionsExt; |
| 249 | |
| 250 | path.metadata() |
| 251 | .is_ok_and(|metadata| metadata.permissions().mode() & 0o111 != 0) |
| 252 | } |
| 253 | |
| 254 | #[cfg(not(unix))] |
| 255 | { |
| 256 | true |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | fn command_exists(command: &str) -> bool { |
| 261 | if command.contains(std::path::MAIN_SEPARATOR) { |
no test coverage detected