mirror of
https://github.com/HeyPuter/puter
synced 2024-11-14 14:03:42 +00:00
Use join. to build target path
This commit is contained in:
parent
5d2a6fce30
commit
5d58764316
@ -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)
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user