Skip to content

Commit adec779

Browse files
committed
refactor: remove unnecessary js_run_devserver mkdirp
1 parent b565b4e commit adec779

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

js/private/js_run_devserver.mjs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -176,17 +176,13 @@ async function syncSymlink(src, dst, sandbox, exists) {
176176
return 1
177177
}
178178

179-
async function syncDirectory(src, dst, sandbox, exists, writePerm) {
179+
async function syncDirectory(src, dst, sandbox, writePerm) {
180180
if (process.env.JS_BINARY__LOG_DEBUG) {
181181
console.error(
182182
`Syncing directory ${src.slice(RUNFILES_ROOT.length + 1)}...`
183183
)
184184
}
185185
const contents = await fs.promises.readdir(src)
186-
if (!exists) {
187-
// Intentionally synchronous; see comment on mkdirpSync
188-
mkdirpSync(dst)
189-
}
190186
return (
191187
await Promise.all(
192188
contents.map(
@@ -264,7 +260,7 @@ async function syncRecursive(src, dst, sandbox, writePerm) {
264260
if (lstat.isSymbolicLink()) {
265261
return syncSymlink(src, dst, sandbox, exists)
266262
} else if (lstat.isDirectory()) {
267-
return syncDirectory(src, dst, sandbox, exists, writePerm)
263+
return syncDirectory(src, dst, sandbox, writePerm)
268264
} else {
269265
const lastChecksum = syncedChecksum.get(src)
270266
const checksum = await generateChecksum(src)
@@ -718,7 +714,7 @@ async function cycleSyncRecurse(cycle, src, dst, sandbox, writePerm) {
718714
}
719715

720716
if (isDirectory) {
721-
return syncDirectory(src, dst, sandbox, exists, writePerm)
717+
return syncDirectory(src, dst, sandbox, writePerm)
722718
} else {
723719
return syncFile(src, dst, exists, lstat, writePerm)
724720
}

0 commit comments

Comments
 (0)