extractor is now called filesystem-device-match

This commit is contained in:
2025-10-13 01:02:51 -07:00
parent 7a63e0325b
commit d63c300bc2
3 changed files with 16 additions and 13 deletions

View File

@@ -1,19 +1,20 @@
use crate::context::SproutContext;
use crate::extractors::filesystem::FileSystemExtractorConfiguration;
use crate::extractors::filesystem_device_match::FilesystemDeviceMatchExtractor;
use anyhow::{Result, bail};
use serde::{Deserialize, Serialize};
use std::rc::Rc;
pub mod filesystem;
pub mod filesystem_device_match;
#[derive(Serialize, Deserialize, Default, Clone)]
pub struct ExtractorDeclaration {
pub filesystem: Option<FileSystemExtractorConfiguration>,
#[serde(default, rename = "filesystem-device-match")]
pub filesystem_device_match: Option<FilesystemDeviceMatchExtractor>,
}
pub fn extract(context: Rc<SproutContext>, extractor: &ExtractorDeclaration) -> Result<String> {
if let Some(filesystem) = &extractor.filesystem {
filesystem::extract(context, filesystem)
if let Some(filesystem) = &extractor.filesystem_device_match {
filesystem_device_match::extract(context, filesystem)
} else {
bail!("unknown extractor configuration");
}