feat: add github reader type

This commit is contained in:
Ivan Shmidt
2020-05-20 15:25:13 +02:00
parent ca83d97591
commit 8f0e5c3f12
2 changed files with 3 additions and 1 deletions
@@ -15,6 +15,7 @@
*/
import { FileLocationSource } from './sources/FileLocationSource';
import { GitHubLocationSource } from './sources/GitHubLocationSource';
import { LocationSource } from './sources/types';
import { LocationReader, ReaderOutput } from './types';
@@ -22,6 +23,7 @@ export class LocationReaders implements LocationReader {
static create(): LocationReader {
return new LocationReaders({
file: new FileLocationSource(),
github: new GitHubLocationSource(),
});
}
@@ -58,7 +58,7 @@ export class GitHubLocationSource implements LocationSource {
let rawYaml;
try {
rawYaml = await fetch(url.toString()).then(x => {
rawYaml = await fetch(url.toString()).then((x) => {
return x.text();
});
} catch (e) {