Skip to content

Commit

Permalink
SOF-6631: implement getFlavorByApplicationVersion method in executable
Browse files Browse the repository at this point in the history
  • Loading branch information
pranabdas committed Aug 10, 2023
1 parent a0134b4 commit c559756
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/executable.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,16 @@ export class Executable extends mix(NamedDefaultableInMemoryEntity).with(Runtime
getFlavorByConfig(config) {
return config ? this.getFlavorByName(config.name) : this.defaultFlavor;
}

getFlavorByApplicationVersion(version) {
const filteredFlavors = this.flavors.filter((flavor) => {
const { supportedApplicationVersions } = flavor.toJSON();
return (
!supportedApplicationVersions ||
(supportedApplicationVersions && supportedApplicationVersions.includes(version))
);
});

return filteredFlavors;
}
}

0 comments on commit c559756

Please sign in to comment.