users/ericsciple/m163tarball_efficient_download
parent
19fb09ae8f
commit
4a1fa615de
|
@ -8391,9 +8391,11 @@ function downloadRepository(accessToken, owner, repo, ref, commit, repositoryPat
|
||||||
ref: refHelper.getDownloadRef(ref, commit)
|
ref: refHelper.getDownloadRef(ref, commit)
|
||||||
};
|
};
|
||||||
const response = yield octokit.repos.getArchiveLink(params);
|
const response = yield octokit.repos.getArchiveLink(params);
|
||||||
|
console.log('GOT THE RESPONSE');
|
||||||
if (response.status != 302) {
|
if (response.status != 302) {
|
||||||
throw new Error(`Unexpected response from GitHub API. Status: '${response.status}'`);
|
throw new Error(`Unexpected response from GitHub API. Status: '${response.status}'`);
|
||||||
}
|
}
|
||||||
|
console.log('GETTING THE LOCATION');
|
||||||
const archiveUrl = response.headers['Location']; // Do not print the archive URL because it has an embedded token
|
const archiveUrl = response.headers['Location']; // Do not print the archive URL because it has an embedded token
|
||||||
assert.ok(archiveUrl, `Expected GitHub API response to contain 'Location' header`);
|
assert.ok(archiveUrl, `Expected GitHub API response to contain 'Location' header`);
|
||||||
// Download the archive
|
// Download the archive
|
||||||
|
|
|
@ -51,11 +51,13 @@ export async function downloadRepository(
|
||||||
ref: refHelper.getDownloadRef(ref, commit)
|
ref: refHelper.getDownloadRef(ref, commit)
|
||||||
}
|
}
|
||||||
const response = await octokit.repos.getArchiveLink(params)
|
const response = await octokit.repos.getArchiveLink(params)
|
||||||
|
console.log('GOT THE RESPONSE')
|
||||||
if (response.status != 302) {
|
if (response.status != 302) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Unexpected response from GitHub API. Status: '${response.status}'`
|
`Unexpected response from GitHub API. Status: '${response.status}'`
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
console.log('GETTING THE LOCATION')
|
||||||
const archiveUrl = response.headers['Location'] // Do not print the archive URL because it has an embedded token
|
const archiveUrl = response.headers['Location'] // Do not print the archive URL because it has an embedded token
|
||||||
assert.ok(
|
assert.ok(
|
||||||
archiveUrl,
|
archiveUrl,
|
||||||
|
|
Loading…
Reference in New Issue