diff --git a/lib/github/tree.js b/lib/github/tree.js index 79b58192..a64bb22f 100644 --- a/lib/github/tree.js +++ b/lib/github/tree.js @@ -58,10 +58,10 @@ class GitHubTree { return `${this.repoUrl}/tree/${commit.slice(0, 10)}/${this.path}`; } - async text(assetPath) { + async buffer(assetPath) { await this.getLastCommit(); const url = this.getAssetUrl(assetPath); - return this.request.text(url); + return this.request.buffer(url); } /** diff --git a/lib/request.js b/lib/request.js index e33b9082..8ba878b8 100644 --- a/lib/request.js +++ b/lib/request.js @@ -37,6 +37,10 @@ class Request { return wrappedFetch(url, options); } + async buffer(url, options = {}) { + return this.fetch(url, options).then(res => res.buffer()); + } + async text(url, options = {}) { return this.fetch(url, options).then(res => res.text()); }