first
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
use anyhow::Result;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
pub fn discover(recipe_dir: &Path) -> Result<Vec<PathBuf>> {
|
||||
let patch_dir = recipe_dir.join("patches");
|
||||
if !patch_dir.exists() {
|
||||
return Ok(Vec::new());
|
||||
}
|
||||
let mut patches = Vec::new();
|
||||
for entry in std::fs::read_dir(&patch_dir)? {
|
||||
let entry = entry?;
|
||||
let path = entry.path();
|
||||
if path.extension().and_then(|ext| ext.to_str()) == Some("patch") {
|
||||
patches.push(path);
|
||||
}
|
||||
}
|
||||
patches.sort();
|
||||
Ok(patches)
|
||||
}
|
||||
Reference in New Issue
Block a user