Skip to content

Commit 175dd91

Browse files
Merge pull request #33 from Exabyte-io/feat/SOF-6631
feat/SOF-6631: prepare libs for hp.x
2 parents ccaf7b3 + bb5cb74 commit 175dd91

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"@exabyte-io/code.js": "2023.8.10-0",
4848
"@exabyte-io/eslint-config": "^2022.11.17-0",
4949
"@exabyte-io/made.js": "2022.6.15-0",
50-
"@exabyte-io/application-flavors.js": "2023.8.11-0",
50+
"@exabyte-io/application-flavors.js": "2023.8.26-0",
5151
"chai": "^4.3.4",
5252
"eslint": "7.32.0",
5353
"eslint-config-airbnb": "19.0.2",

src/application.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,17 @@ export class Application extends NamedDefaultableInMemoryEntity {
9696

9797
get executables() {
9898
const tree = getAppTree(this.prop("name"));
99-
return Object.keys(tree).map((key) => {
100-
return new this.constructor.Executable({ ...tree[key], name: key });
101-
});
99+
return Object.keys(tree)
100+
.filter((key) => {
101+
const { supportedApplicationVersions } = tree[key];
102+
return (
103+
!supportedApplicationVersions ||
104+
supportedApplicationVersions.includes(this.prop("version"))
105+
);
106+
})
107+
.map((key) => {
108+
return new this.constructor.Executable({ ...tree[key], name: key });
109+
});
102110
}
103111

104112
get hasAdvancedComputeOptions() {

src/executable.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,13 @@ export class Executable extends mix(NamedDefaultableInMemoryEntity).with(Runtime
4141
getFlavorByConfig(config) {
4242
return config ? this.getFlavorByName(config.name) : this.defaultFlavor;
4343
}
44+
45+
getFlavorsByApplicationVersion(version) {
46+
const filteredFlavors = this.flavors.filter((flavor) => {
47+
const supportedApplicationVersions = flavor.prop("supportedApplicationVersions");
48+
return !supportedApplicationVersions || supportedApplicationVersions.includes(version);
49+
});
50+
51+
return filteredFlavors;
52+
}
4453
}

0 commit comments

Comments
 (0)