account for file:// when resolving app root

This commit is contained in:
Garrett Mills 2020-09-05 10:37:13 -05:00
parent e21624368f
commit f19adc5bf3
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246

View File

@ -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
}
}
/**