Resolve existing scaffolding for env function

This commit is contained in:
Garrett Mills 2020-09-05 10:12:33 -05:00
parent c0e1e1d2a4
commit 4b341b43e0
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246

View File

@ -4,7 +4,7 @@ import { Logging } from '../service/logging/Logging.ts'
import StandardLogger from '../service/logging/StandardLogger.ts'
import { isLoggingLevel } from '../service/logging/types.ts'
import Utility from '../service/utility/Utility.ts'
import { make } from '../../../di/src/global.ts'
import {container, make} from '../../../di/src/global.ts'
import 'https://deno.land/x/dotenv/load.ts'
import { Container } from '../../../di/src/Container.ts'
import { Inject } from '../../../di/src/decorator/Injection.ts'
@ -18,7 +18,8 @@ import { path } from '../external/std.ts'
* @return any
*/
const env = (name: string, fallback?: any) => {
const scaffolding = make(Scaffolding)
// const scaffolding = make(Scaffolding)
const scaffolding = container.get_existing_instance(Scaffolding)
return scaffolding.env(name) ?? fallback
}