Use join. to build target path

This commit is contained in:
Nariman Jelveh 2024-07-22 16:38:45 -07:00
parent 5d2a6fce30
commit 5d58764316

View File

@ -878,22 +878,17 @@ window.available_templates = async () => {
? ''
: element.name.slice(extIndex + 1);
console.log(extension)
if(extension == "txt") extension = "text"
// TODO: should use path join utility
const path =
baseRoute + "/" +
hasTemplateFolder.name + '/' +
element.name;
const _path = path.join( baseRoute, hasTemplateFolder.name, element.name);
console.log(_path)
const itemStructure = {
path,
path: _path,
html: `${extension.toUpperCase()} ${name}`,
extension:extension,
name: element.name
}
console.log(extension)
result.push(itemStructure)
});