Skip to content

Commit be69524

Browse files
committed
Use atomicFS in site-directory
To see if calling writ.build too quickly causes the EBUSY errors in tests
1 parent fc5bcf6 commit be69524

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ssg/site-directory.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { rm, mkdir } = require('fs/promises')
1+
const { atomicReplace, atomicFS } = require('./lib/fileSystemHelpers')
22
const Settings = require('./settings')
33
const Debug = require('./debug')
44

@@ -10,11 +10,11 @@ const create = async () => {
1010
throw new Error(`Dangerous export directory: "${exportDirectory}". Won't continue.`)
1111
}
1212
try {
13-
await rm(out, { recursive: true })
13+
await atomicFS.rm(out, { recursive: true })
1414
}
1515
catch (ENOENT) {}
1616
finally {
17-
return mkdir(out).then(() => {
17+
return atomicFS.mkdir(out).then(() => {
1818
Debug.timeEnd('site directory')
1919
})
2020
}

0 commit comments

Comments
 (0)