Update application bootstrapping to load .env from repo root
This commit is contained in:
@@ -242,14 +242,22 @@ export class Application extends Container {
|
||||
* @protected
|
||||
*/
|
||||
protected bootstrapEnvironment(): void {
|
||||
logIfDebugging('extollo.env', `.env path: ${this.basePath.concat('.env').toLocal}`)
|
||||
const path = this.basePath.concat('.env').toLocal
|
||||
let path = this.basePath.concat('.env').toLocal
|
||||
logIfDebugging('extollo.env', `Trying .env path: ${path}`)
|
||||
if ( fs.existsSync(path) ) {
|
||||
dotenv.config({
|
||||
path,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
path = this.basePath.concat('../.env').toLocal
|
||||
logIfDebugging('extollo.env', `Trying .env path: ${path}`)
|
||||
if ( fs.existsSync(path) ) {
|
||||
dotenv.config({
|
||||
path,
|
||||
})
|
||||
}
|
||||
logIfDebugging('extollo.env', process.env)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user