Skip to content

Commit

Permalink
Clean up temp bundle when make() throws (#2292)
Browse files Browse the repository at this point in the history
Fixes #2290
  • Loading branch information
FUDCo committed May 17, 2024
2 parents e3c9611 + 97c6aed commit 03eff8f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/cli/src/commands/make.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,15 @@ export const makeCommand = async ({
resultPath,
)
: E(agent).makeBundle(workerName, bundleName, powersName, resultPath);
const result = await resultP;
console.log(result);

if (temporaryBundleName) {
await E(agent).remove(temporaryBundleName);
let result;
try {
result = await resultP;
console.log(result);
} finally {
if (temporaryBundleName) {
await E(agent).remove(temporaryBundleName);
}
}
return result;
});
};

0 comments on commit 03eff8f

Please sign in to comment.