Fix node type resolution (#714)

Fixes #712 and #713.
pull/715/head
Arijit Basu 3 weeks ago committed by GitHub
commit 8afdf9e478
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -104,7 +104,7 @@ impl NodeTypesConfig {
node_type = node_type.extend(conf);
}
if let Some(conf) = self.extension.get(&node.extension) {
if let (Some(conf), false) = (self.extension.get(&node.extension), node.is_dir) {
node_type = node_type.extend(conf);
}

@ -160,7 +160,7 @@ pub fn is_dir<'a>(util: Table<'a>, lua: &Lua) -> Result<Table<'a>> {
/// ```
pub fn is_file<'a>(util: Table<'a>, lua: &Lua) -> Result<Table<'a>> {
let func =
lua.create_function(move |_, path: String| Ok(PathBuf::from(path).is_dir()))?;
lua.create_function(move |_, path: String| Ok(PathBuf::from(path).is_file()))?;
util.set("is_file", func)?;
Ok(util)
}

Loading…
Cancel
Save