From 9890881d8a76493b6566df2a04ea61ea3f55407e Mon Sep 17 00:00:00 2001 From: Alessandro Chitolina Date: Mon, 13 Nov 2023 19:30:29 +0100 Subject: [PATCH] [Runtime] fix: find project dir via autoloader finder --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 60beab3..5a5d984 100644 --- a/index.js +++ b/index.js @@ -21,7 +21,9 @@ const mainExports = trampoline(file); let runtime = nullish(process.env.APP_RUNTIME, () => Jymfony.Component.Runtime.JymfonyRuntime); const reflection = new ReflectionClass(runtime); -runtime = reflection.newInstance(Object.assign({ project_dir: dirname(file) }, nullish(globalThis.APP_RUNTIME_OPTIONS, () => ({})))); +runtime = reflection.newInstance(Object.assign({ + project_dir: __jymfony.autoload.finder.findRoot(), +}, nullish(globalThis.APP_RUNTIME_OPTIONS, () => ({})))); let [ app, args ] = runtime.getResolver(mainExports['default']).resolve(); (async function () {