feat: add github reader type
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user