Skip to content

Commit

Permalink
fix(crawler): avoid fail crawl when no yaml file present (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
marianfoo committed Apr 13, 2022
1 parent 1fc64ea commit 42b3479
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions packages/crawler/src/gh-repos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,25 @@ export default class GitHubRepositoriesProvider {
for (const subpackage of source.subpackages) {
const path = `${source.subpath}/${subpackage.name}/`;
let packageInfo = await this.fetchRepo(source, path, repoInfo, subpackage);
packageInfo["jsdoc"] = await this.getJsdoc(source, path);

if (source.type === "task" || source.type === "middleware" || source.type === "tooling") {
try {
packageInfo["jsdoc"] = await this.getJsdoc(source, path);
} catch (error) {
console.log(`Error while fetching jsdoc for ${source.path}`);
}
}
packages.push(packageInfo);
}
} else {
const repoInfo = await this.getRepoInfo(source);
let packageInfo = await this.fetchRepo(source, "", repoInfo, source);
packageInfo["jsdoc"] = await this.getJsdoc(source, "");

if (source.type === "task" || source.type === "middleware" || source.type === "tooling") {
try {
packageInfo["jsdoc"] = await this.getJsdoc(source, "");
} catch (error) {
console.log(`Error while fetching jsdoc for ${source.path}`);
}
}
packages.push(packageInfo);
}
}
Expand Down

0 comments on commit 42b3479

Please sign in to comment.