Lists only the files in the root of a directory (non-recursive). # Arguments `path` - A reference to the directory path # Returns `Vec ` - A vector of file paths
(path: &std::path::Path)
| 461 | /// |
| 462 | /// * `Vec<std::path::PathBuf>` - A vector of file paths |
| 463 | fn list_root_files(path: &std::path::Path) -> Vec<std::path::PathBuf> { |
| 464 | fs::read_dir(path) |
| 465 | .expect("Failed to read directory") |
| 466 | .filter_map(|entry| { |
| 467 | let entry = entry.expect("Failed to read entry"); |
| 468 | let path = entry.path(); |
| 469 | if path.is_file() { |
| 470 | Some(path) |
| 471 | } else { |
| 472 | None |
| 473 | } |
| 474 | }) |
| 475 | .collect() |
| 476 | } |
| 477 | |
| 478 | /// Runs a software stack from a stack bundle based on its flavor. |
| 479 | /// |