From 3fa0f4e926d0f204d66f76579b6579328d02fdc9 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Sun, 4 Feb 2024 15:15:07 +0100 Subject: [PATCH] Search for backends in more directories --- kfile.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/kfile.js b/kfile.js index 8a79a0793..771ae845f 100644 --- a/kfile.js +++ b/kfile.js @@ -567,7 +567,16 @@ if (plugin) { else if (platform === Platform.PS5) { backend = 'PlayStation5' } - const pluginPath = path.join(__dirname, '..', 'Backends', backend); + + let ancestor = project; + while (ancestor.parent != null) { + ancestor = ancestor.parent; + } + + let pluginPath = path.join(ancestor.basedir, 'Backends', backend); + if (!fs.existsSync(pluginPath)) { + pluginPath = path.join(__dirname, '..', 'Backends', backend); + } if (!fs.existsSync(pluginPath)) { log.error('Was looking for a backend in ' + pluginPath + ' but it wasn\'t there.'); throw 'backend not found';