From 2c913044ebf1a7eabfbbfa10af6f37163894a575 Mon Sep 17 00:00:00 2001 From: Thena Seer Date: Tue, 2 Nov 2021 08:14:26 -0700 Subject: [PATCH] Add RawGithubReadInstance wrapper for improved UX (#3250) --- packages/sourcecred/src/api/instance/readInstance.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/sourcecred/src/api/instance/readInstance.js b/packages/sourcecred/src/api/instance/readInstance.js index e2fe6af08..d85fb43b3 100644 --- a/packages/sourcecred/src/api/instance/readInstance.js +++ b/packages/sourcecred/src/api/instance/readInstance.js @@ -58,6 +58,16 @@ import * as Combo from "../../util/combo"; export const getNetworkReadInstance = (base: string): ReadInstance => new ReadInstance(new NetworkStorage(base)); +export const getRawGithubReadInstance = ( + organization: string, + repository: string, + branch: string +): ReadInstance => + new ReadInstance( + new NetworkStorage( + `https://raw.githubusercontent.com/${organization}/${repository}/${branch}/` + ) + ); export const getOriginReadInstance = (base: string): ReadInstance => new ReadInstance(new OriginStorage(base));