mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-02-13 10:52:53 +00:00
feat: download zip instead of tar
This commit is contained in:
@@ -30,7 +30,7 @@ export default class GitHubDownload extends GitHubBase implements SourceBase {
|
||||
auth?: string
|
||||
): Promise<OctokitResponse<unknown, 302>> {
|
||||
const octokit = new Octokit({ auth });
|
||||
return octokit.rest.repos.downloadTarballArchive({
|
||||
return octokit.rest.repos.downloadZipballArchive({
|
||||
owner: this.githubRepository.owner,
|
||||
repo: this.githubRepository.repo,
|
||||
ref: this.branch?.commit || "HEAD",
|
||||
@@ -97,7 +97,7 @@ export default class GitHubDownload extends GitHubBase implements SourceBase {
|
||||
try {
|
||||
const downloadStream = got.stream(response.url);
|
||||
downloadStream.addListener("downloadProgress", (p) => (progress = p));
|
||||
await storage.extractTar(originalPath, downloadStream);
|
||||
await storage.extractZip(originalPath, downloadStream);
|
||||
} catch (error) {
|
||||
await this.repository.updateStatus("error", "unable_to_download");
|
||||
throw new AnonymousError("unable_to_download", {
|
||||
|
||||
Reference in New Issue
Block a user