diff --git a/lib/main.js b/lib/main.js index 12c3afa..11df3c9 100644 --- a/lib/main.js +++ b/lib/main.js @@ -28,11 +28,11 @@ function run() { yield exec.exec('rpmdev-setuptree'); // Copy spec file from path specFile to /root/rpmbuild/SPECS/ yield io.cp(`/github/workspace/${specFile}`, '/github/home/rpmbuild/SPECS/'); - yield exec.exec(`cp -R /github/workspace/ /tmp/${repo}`); - yield exec.exec(`tar -czvf ${repo}.tar.gz ${repo}`, { cwd: "/tmp" }); + yield exec.exec(`cp -R /github/workspace/ ${repo}`); + yield exec.exec(`tar -czvf ${repo}.tar.gz ${repo}`); // Get repo files from /github/workspace/ - yield exec.exec('ls -la /tmp'); - yield exec.exec(`cp /tmp/${repo}.tar.gz /github/home/rpmbuild/SOURCES/`); + yield exec.exec('ls -la '); + yield exec.exec(`cp ${repo}.tar.gz /github/home/rpmbuild/SOURCES/`); // 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'); diff --git a/src/main.ts b/src/main.ts index 1148c1e..d42dd7a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -25,13 +25,13 @@ async function run() { // Copy spec file from path specFile to /root/rpmbuild/SPECS/ await io.cp(`/github/workspace/${specFile}`, '/github/home/rpmbuild/SPECS/'); - await exec.exec(`cp -R /github/workspace/ /tmp/${repo}`); + await exec.exec(`cp -R /github/workspace/ ${repo}`); - await exec.exec(`tar -czvf ${repo}.tar.gz ${repo}`, { cwd : "/tmp"}); + await exec.exec(`tar -czvf ${repo}.tar.gz ${repo}`); // Get repo files from /github/workspace/ - await exec.exec('ls -la /tmp'); - await exec.exec(`cp /tmp/${repo}.tar.gz /github/home/rpmbuild/SOURCES/`); + await exec.exec('ls -la '); + await exec.exec(`cp ${repo}.tar.gz /github/home/rpmbuild/SOURCES/`); // Copy tar.gz file to /root/rpmbuild/SOURCES // make sure the name of tar.gz is same as given in Source of spec file