Skip to content

Commit

Permalink
feat(cli): discover additional app-config yamls
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Jerolimov <[email protected]>
  • Loading branch information
christoph-jerolimov committed Nov 4, 2024
1 parent 7b75a96 commit 1c06b84
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions packages/cli/src/commands/package-dynamic-plugins/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean>((fileName: string) => {
const candidate = path.join(directory, fileName);
return fs.existsSync(candidate);
})
.reduce<string | undefined>((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));
}

/**
Expand Down

0 comments on commit 1c06b84

Please sign in to comment.