From f19adc5bf3ec4cb09343b9a657ae6643058cd4a0 Mon Sep 17 00:00:00 2001 From: garrettmills Date: Sat, 5 Sep 2020 10:37:13 -0500 Subject: [PATCH] account for file:// when resolving app root --- lib/src/lifecycle/Application.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/src/lifecycle/Application.ts b/lib/src/lifecycle/Application.ts index ed23f1b..be3163d 100644 --- a/lib/src/lifecycle/Application.ts +++ b/lib/src/lifecycle/Application.ts @@ -123,7 +123,17 @@ export default class Application { * @type string */ get app_root() { - return path.resolve(this.injector.make(Scaffolding).base_dir, 'app') + let base_dir = this.injector.make(Scaffolding).base_dir + if ( base_dir.startsWith('file://') ) { + base_dir = base_dir.slice(7) + } + + const resolved = path.resolve(base_dir, 'app') + if ( resolved.startsWith('/') ) { + return `file://${resolved}` + } else { + return resolved + } } /**