diff --git a/lib/main.js b/lib/main.js index 11df3c9..a510e9f 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/ ${repo}`); - yield exec.exec(`tar -czvf ${repo}.tar.gz ${repo}`); + yield exec.exec(`cp -R /github/workspace/ /github/home/${repo}`); + yield exec.exec(`cd /github/home && tar -czvf ${repo}.tar.gz ${repo}`); // Get repo files from /github/workspace/ yield exec.exec('ls -la '); - yield exec.exec(`cp ${repo}.tar.gz /github/home/rpmbuild/SOURCES/`); + yield exec.exec(`cp /github/home/${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 d42dd7a..463c6b0 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/ ${repo}`); + await exec.exec(`cp -R /github/workspace/ /github/home/${repo}`); - await exec.exec(`tar -czvf ${repo}.tar.gz ${repo}`); + await exec.exec(`cd /github/home && tar -czvf ${repo}.tar.gz ${repo}`); // Get repo files from /github/workspace/ await exec.exec('ls -la '); - await exec.exec(`cp ${repo}.tar.gz /github/home/rpmbuild/SOURCES/`); + await exec.exec(`cp /github/home/${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