await API call

This commit is contained in:
Naveenraj M
2020-03-29 20:55:40 +05:30
parent 3d12753e2b
commit 1c5fc49e9e
2 changed files with 3 additions and 3 deletions

View File

@ -19,7 +19,7 @@ function download_archive(owner, repo, ref) {
const tag = "v1.0.0"; const tag = "v1.0.0";
const tarFile = `${tag}.tar.gz`; const tarFile = `${tag}.tar.gz`;
console.log("Calling API ..."); console.log("Calling API ...");
octokit.repos.getArchiveLink({ yield octokit.repos.getArchiveLink({
owner, owner,
repo, repo,
archive_format, archive_format,

View File

@ -15,13 +15,13 @@ async function download_archive(owner, repo, ref ) {
const tarFile = `${tag}.tar.gz`; const tarFile = `${tag}.tar.gz`;
console.log("Calling API ..."); console.log("Calling API ...");
octokit.repos.getArchiveLink({ await octokit.repos.getArchiveLink({
owner, owner,
repo, repo,
archive_format, archive_format,
ref ref
}).then(( { data }) => { }).then(( { data }) => {
fs.writeFile(tarFile, Buffer.from(data), function(err){ fs.writeFile(tarFile, Buffer.from(data), function(err){
if(err) { if(err) {
return console.log(err); return console.log(err);
} }