mirror of
https://github.com/step-security/harden-runner.git
synced 2026-06-08 04:47:06 +00:00
added cache-saving in try-catch block
This commit is contained in:
parent
86770f2db4
commit
56018545c2
1 changed files with 9 additions and 5 deletions
|
|
@ -70,11 +70,15 @@ import path from "path";
|
|||
console.log("Service log:");
|
||||
console.log(journalLog);
|
||||
}
|
||||
const cmd = "sudo";
|
||||
const args = ["cp", path.join(__dirname, "cache.txt"), cacheFile];
|
||||
cp.execFileSync(cmd, args);
|
||||
const cacheResult = await cache.saveCache([cacheFile], cacheKey);
|
||||
console.log(cacheResult);
|
||||
try {
|
||||
const cmd = "sudo";
|
||||
const args = ["cp", path.join(__dirname, "cache.txt"), cacheFile];
|
||||
cp.execFileSync(cmd, args);
|
||||
const cacheResult = await cache.saveCache([cacheFile], cacheKey);
|
||||
console.log(cacheResult);
|
||||
} catch (exception) {
|
||||
console.log(exception);
|
||||
}
|
||||
})();
|
||||
|
||||
function sleep(ms) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue