From 0c4b8c11d78b4969bacf73785bc9dae13c35f75f Mon Sep 17 00:00:00 2001 From: garrettmills Date: Sat, 5 Sep 2020 10:41:39 -0500 Subject: [PATCH] remove file:// on view engine fs walk --- lib/src/unit/ViewEngine.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/unit/ViewEngine.ts b/lib/src/unit/ViewEngine.ts index 5107447..a38ba6a 100644 --- a/lib/src/unit/ViewEngine.ts +++ b/lib/src/unit/ViewEngine.ts @@ -186,10 +186,14 @@ console.log('template path resolved 1', resolved_path) protected async init_engine_handlebars() { const partials_dir: unknown = this.config.get('app.views.partials_dir') if ( String(partials_dir) ) { - const partials_path = this.template_path(String(partials_dir)) + let partials_path = this.template_path(String(partials_dir)) console.log({ partials_path, partials_dir }) this.logger.info(`Registering Handlebars partials from: ${partials_path}`) + if ( partials_path.startsWith('file://') ) { + partials_path = partials_path.slice(7) + } + for await ( const entry of fs.walk(partials_path) ) { if ( !entry.isFile || !entry.path.endsWith(this.get_file_extension()) ) { if ( entry.isFile ) this.logger.debug(`Skipping file in Handlebars partials path with invalid suffix: ${entry.path}`)