Skip to content

Commit c428d7f

Browse files
committed
chore: do not ignore errors when clearing the npm/ output directory
rmSync already ignores a missing directory via force: true, so the try/catch only swallowed real errors such as EACCES or EBUSY. Since package.json ships the entire npm/ folder, a partially cleared output directory meant stale JavaScript from earlier builds could be published.
1 parent 1195275 commit c428d7f

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

.npm/compile.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@ const __dirname = dirname(fileURLToPath(import.meta.url))
1414

1515
const outDir = path.join(__dirname, '..', 'npm')
1616

17-
try {
18-
rmSync(outDir, { recursive: true, force: true })
19-
} catch {
20-
// pass
21-
}
17+
rmSync(outDir, { recursive: true, force: true })
2218

2319
for await (const file of glob(
2420
tsconfig.include.map((include) => path.join('.npm', include)),

0 commit comments

Comments
 (0)