Skip to content

Commit 89c1b43

Browse files
committed
walkthrough: use safeDeleteSync instead of fs.unlinkSync
Matches the fleet convention of routing all filesystem deletion through @socketsecurity/lib's safe helpers, regardless of blast radius. The previous unlinkSync call was scoped to a specific known path so the risk was low, but going through safeDeleteSync keeps the audit story uniform and gives us free retry/abort handling.
1 parent 170a6dc commit 89c1b43

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/walkthrough.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import {
2121
readFileSync,
2222
readdirSync,
2323
statSync,
24-
unlinkSync,
2524
writeFileSync,
2625
} from 'node:fs'
26+
import { safeDeleteSync } from '@socketsecurity/lib/fs'
2727
import { createServer } from 'node:http'
2828
import path from 'node:path'
2929
import process from 'node:process'
@@ -796,7 +796,7 @@ async function generate(
796796
const newPath = path.join(walkthroughDir, `${newName}.html`)
797797
writeFileSync(newPath, html)
798798
if (newPath !== htmlPath) {
799-
unlinkSync(htmlPath)
799+
safeDeleteSync(htmlPath)
800800
}
801801
continue
802802
}

0 commit comments

Comments
 (0)