Skip to content

Commit

Permalink
Fix node type resolution (#714)
Browse files Browse the repository at this point in the history
Fixes #712 and #713.
  • Loading branch information
sayanarijit committed May 3, 2024
2 parents ad8afa9 + a48dae0 commit 8afdf9e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion src/lua/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 8afdf9e

Please sign in to comment.