mirror of
https://github.com/edera-dev/sprout.git
synced 2025-12-20 00:40:18 +00:00
extractor is now called filesystem-device-match
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user