diff --git a/src/cleanup.ts b/src/cleanup.ts index 7071d18..205efd7 100644 --- a/src/cleanup.ts +++ b/src/cleanup.ts @@ -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) {