Skip to content

Commit

Permalink
fix: [CLI] Handle errors while deleting files gracefully (#695)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmn authored Sep 24, 2024
1 parent deaa7ce commit 2b77aad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/cli/src/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ export async function compileDirectory(
config.state.styleXRules.delete(file);
const outputPath = path.join(config.output, file);
if (fs.existsSync(outputPath)) {
fs.rmSync(outputPath);
try {
fs.rmSync(outputPath);
} catch (err) {
console.error('[stylex] failed to delete file: ', err);
}
}
});
}
Expand Down

0 comments on commit 2b77aad

Please sign in to comment.