Skip to content

Commit e418c6a

Browse files
filter .DS_Store file from addons list (#147)
* filter .DS_Store file from addons list * Revert "filter .DS_Store file from addons list" This reverts commit bd0f192. * fix: ignore .DS_Store during addon discovery * filter .DS_Store from addons before checking if none are found * use length of addons array to check if none exist --------- Co-authored-by: carsakiller <[email protected]>
1 parent 6fa70d7 commit e418c6a

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

client/src/addon_manager/services/addonManager.service.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,16 @@ class AddonManager {
3131
});
3232
}
3333

34-
const addons = await filesystem.readDirectory(installLocation);
35-
36-
for (const addon of addons ?? []) {
34+
const ignoreList = [".DS_Store"];
35+
let addons = await filesystem.readDirectory(installLocation);
36+
if (addons) {
37+
addons = addons.filter((a) => !ignoreList.includes(a.name));
38+
}
39+
if (!addons || addons.length === 0) {
40+
localLogger.warn("No addons found in installation folder");
41+
return;
42+
}
43+
for (const addon of addons) {
3744
this.addons.set(addon.name, new Addon(addon.name, addon.uri));
3845
localLogger.verbose(`Found ${addon.name}`);
3946
}

0 commit comments

Comments
 (0)