diff --git a/lib/main.js b/lib/main.js index 9ef6535..92b2048 100644 --- a/lib/main.js +++ b/lib/main.js @@ -29,13 +29,17 @@ function run() { // Copy spec file from path specFile to /root/rpmbuild/SPECS/ yield io.cp('/github/workspace/cello.spec', '/root/rpmbuild/SPECS/'); // Get tar.gz file of release - const tarBallPath = yield download_tar(owner, repo, ref); - console.log(`Tar Path for copy : ${tarBallPath}`); + yield download_tar(owner, repo, ref).then(function (filePath) { + io.cp(filePath, '/root/rpmbuild/SOURCES'); + }).catch(function (error) { + console.log(error); + }); + //console.log(`Tar Path for copy : ${tarBallPath}`); // Get repo files from /github/workspace/ yield exec.exec('ls -la '); // Copy tar.gz file to /root/rpmbuild/SOURCES // make sure the name of tar.gz is same as given in Source of spec file - yield io.cp(tarBallPath, '/root/rpmbuild/SOURCES'); + //await io.cp(tarBallPath, '/root/rpmbuild/SOURCES'); // Execute rpmbuild try { yield exec.exec(`rpmbuild -ba ${specFile}`); diff --git a/src/main.ts b/src/main.ts index 05dc3a8..9378d56 100644 --- a/src/main.ts +++ b/src/main.ts @@ -26,16 +26,24 @@ async function run() { await io.cp('/github/workspace/cello.spec', '/root/rpmbuild/SPECS/'); // Get tar.gz file of release - const tarBallPath = await download_tar(owner, repo, ref); + await download_tar( + owner, + repo, + ref + ).then( function(filePath){ + io.cp(filePath, '/root/rpmbuild/SOURCES'); + }).catch(function(error){ + console.log(error); + }); - console.log(`Tar Path for copy : ${tarBallPath}`); + //console.log(`Tar Path for copy : ${tarBallPath}`); // Get repo files from /github/workspace/ await exec.exec('ls -la '); // Copy tar.gz file to /root/rpmbuild/SOURCES // make sure the name of tar.gz is same as given in Source of spec file - await io.cp(tarBallPath, '/root/rpmbuild/SOURCES'); + //await io.cp(tarBallPath, '/root/rpmbuild/SOURCES'); // Execute rpmbuild try {