From 1c06b8421db967b7257034ff0ce2c8f914cb7555 Mon Sep 17 00:00:00 2001 From: Christoph Jerolimov Date: Mon, 4 Nov 2024 22:13:37 +0100 Subject: [PATCH] feat(cli): discover additional app-config yamls Signed-off-by: Christoph Jerolimov --- .../commands/package-dynamic-plugins/command.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/packages/cli/src/commands/package-dynamic-plugins/command.ts b/packages/cli/src/commands/package-dynamic-plugins/command.ts index c7183f24b6..fb062f47f1 100644 --- a/packages/cli/src/commands/package-dynamic-plugins/command.ts +++ b/packages/cli/src/commands/package-dynamic-plugins/command.ts @@ -293,21 +293,16 @@ function discoverPluginConfigurationFile( ): string | undefined { // Possible file names, the first match will be used const supportedFilenames = [ + 'app-config.dynamic.example.yaml', + 'app-config.dynamic.yaml', 'app-config.janus-idp.yaml', 'app-config.backstage-community.yaml', + 'app-config.example.yaml', 'app-config.yaml', ]; return supportedFilenames - .map((fileName: string) => { - const candidate = path.join(directory, fileName); - return fs.existsSync(candidate); - }) - .reduce((val, current, index) => { - if (typeof val === 'undefined' && current) { - return path.join(directory, supportedFilenames[index]); - } - return val; - }, undefined); + .map(fileName => path.join(directory, fileName)) + .find(candidate => fs.existsSync(candidate)); } /**