mirror of
https://github.com/edera-dev/sprout.git
synced 2026-11-05 00:52:21 +00:00
extractor is now called filesystem-device-match
This commit is contained in:
3 files changed
+16
-13
No files matched your search
+6
-5
@@ -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