debug view engine paths

This commit is contained in:
2020-09-05 10:29:30 -05:00
parent c8d9f80579
commit fa337864b4

View File

@@ -94,11 +94,17 @@ export default class ViewEngine extends LifecycleUnit {
* @return string
*/
public template_path(...parts: string[]): string {
console.log('template path parts', parts)
if ( !this.template_dir ) throw new MissingTemplateDirectoryError()
let template_dir = this.template_dir
if ( template_dir.startsWith('file://') ) template_dir = template_dir.slice(7)
console.log('template path dir', template_dir)
const resolved_path = path.resolve(template_dir, ...parts)
console.log('template path resolved 1', resolved_path)
if ( resolved_path.startsWith('/') ) {
return `file://${resolved_path}`
} else {