);
let mut source = DirNode::build(opts.source.clone(), opts)?;
- let global_init = MetaFile::new(opts);
+
+ let global_init = if source.path.join("default.meta").exists() {
+ MetaFile::build(source.path.join("default.meta"), &opts)?
+ } else {
+ MetaFile::new(&opts)
+ };
source.map(&global_init)?;
source.build_dir()
#[derive(Debug, Clone)]
pub struct DirNode<'a> {
- path: PathBuf,
- opts: &'a Options,
- global: MetaFile<'a>,
- files: Vec<MetaFile<'a>>,
- dirs: Vec<DirNode<'a>>,
+ pub path: PathBuf,
+ pub opts: &'a Options,
+ pub global: MetaFile<'a>,
+ pub files: Vec<MetaFile<'a>>,
+ pub dirs: Vec<DirNode<'a>>,
}
impl<'a> DirNode<'a> {
// parses all contained files and directories and pushes
// parsed structures into the files and directories vectors
pub fn map(&mut self, global: &'a MetaFile) -> Result<()> {
- if self.opts.parallel {}
-
for f in fs::read_dir(&self.path)? {
let file = f?.path();
}
}
+ eprintln!("{:#?}", self);
+
Ok(())
}
};
let mut metafile = parse_string(str, opts)?;
- if metafile.header.ignore {
- return Err(MetaError::Ignored.into());
- }
-
metafile.path = path;
Ok(metafile)
}