Skip to content

Commit fd841cf

Browse files
committed
Fix globbing of service models using new filenames.
Caused by #379, reported in #383.
1 parent fdba4f7 commit fd841cf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/api_loader.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ function buildServiceMap() {
2020
});
2121

2222
fs.readdirSync(apiRoot).forEach(function (file) {
23-
var match = file.match(/^(.+?)-(\d+-\d+-\d+)\.normal\.json$/);
23+
var match = file.match(/^(.+?)-(\d+-\d+-\d+)\.(normal|min)\.json$/);
2424
if (match) {
2525
var id = prefixMap[match[1]], version = match[2];
2626
if (serviceMap[id]) {
2727
serviceMap[id].versions = serviceMap[id].versions || [];
28-
serviceMap[id].versions.push(version);
28+
if (serviceMap[id].versions.indexOf(version) < 0) {
29+
serviceMap[id].versions.push(version);
30+
}
2931
}
3032
}
3133
});

0 commit comments

Comments
 (0)