Skip to content

Commit 447ca43

Browse files
committed
allow app IDs with '.' in - ignore files which we know exist
1 parent 2874269 commit 447ca43

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

js/index.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ function extractAppNameFromHref(href) {
121121
href = href.replace(/^\/+|\/+$/g, '');
122122
if (!href) return null; // was just /, throw it out
123123

124-
const parts = href.split('/').filter(Boolean);
125-
if (parts.length === 0) return null;
124+
const parts = href.split('/').filter(p=>p!="");
126125
// allow './' prefixes by dropping leading '.' segments
127126
while (parts.length && parts[0] === '.') parts.shift();
128127
if (parts.length === 0) return null; // skip if it was current dir only
@@ -136,8 +135,6 @@ function extractAppNameFromHref(href) {
136135
if (!candidate) return null;
137136
// if the only thing we found is 'apps', ignore it
138137
if (candidate.toLowerCase() === 'apps') return null;
139-
// skip names with periods
140-
if (candidate.includes('.')) return null;
141138
return candidate;
142139
}
143140

@@ -167,13 +164,15 @@ httpGet(Const.APPS_JSON_FILE).then(apps=>{
167164
let xmlDoc = parser.parseFromString(htmlText,"text/html");
168165
appJSON = [];
169166
let promises = [];
167+
let appsLoaded = [];
170168
htmlToArray(xmlDoc.querySelectorAll("a")).forEach(a=>{
171169
let href = a.getAttribute("href");
172170
const appName = extractAppNameFromHref(href);
173171
// Skip anything that doesn't look like an app or is an _example_app
174-
if (!appName || appName.startsWith("_")) {
172+
if (!appName || appName.startsWith("_") || ["lint_exemptions.js","unknown.png"].includes(appName))
175173
return;
176-
}
174+
if (appsLoaded.includes(appName)) return; // avoid duplicates
175+
appsLoaded.push(appName);
177176
let metadataURL = appsURL+appName+"/metadata.json";
178177
console.log(" - Loading "+metadataURL);
179178
promises.push(httpGet(metadataURL).then(metadataText=>{

0 commit comments

Comments
 (0)