mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-10 04:21:20 +00:00
fix: detect api from the list by the root file match (#903)
* fix: detect api from the list by the root file match * chore: fix prettier
This commit is contained in:
@@ -48,7 +48,14 @@ function isNotEmptyArray<T>(args?: T[]): boolean {
|
||||
function getAliasOrPath(config: Config, aliasOrPath: string): Entrypoint {
|
||||
return config.apis[aliasOrPath]
|
||||
? { path: config.apis[aliasOrPath]?.root, alias: aliasOrPath }
|
||||
: { path: aliasOrPath };
|
||||
: {
|
||||
path: aliasOrPath,
|
||||
// find alias by path, take the first match
|
||||
alias:
|
||||
Object.entries(config.apis).find(([_alias, api]) => {
|
||||
return path.resolve(api.root) === path.resolve(aliasOrPath);
|
||||
})?.[0] ?? undefined,
|
||||
};
|
||||
}
|
||||
|
||||
async function expandGlobsInEntrypoints(args: string[], config: Config) {
|
||||
|
||||
Reference in New Issue
Block a user