Skip to content

Commit 47c2241

Browse files
committed
fix: Strip .tpl from target path when loading files
1 parent 5530ef3 commit 47c2241

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/core/file.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,15 @@ pub fn get_files(dir: &Path) -> Result<Vec<File>, errors::Error> {
8585
let name = e.file_name().to_string_lossy();
8686
let is_template = name.ends_with(".tpl");
8787

88+
let target_path = if is_template {
89+
e.path().with_extension("")
90+
} else {
91+
e.path().to_owned()
92+
};
93+
8894
File {
8995
group: group.clone(),
90-
relative_path: e.path().strip_prefix(dir).unwrap().to_owned(),
96+
relative_path: target_path.strip_prefix(dir).unwrap().to_owned(),
9197
source_path: e.path().to_owned(),
9298
is_template,
9399
}

0 commit comments

Comments
 (0)