Skip to content

Commit 5256025

Browse files
committed
chore: use readdir
1 parent c41fd52 commit 5256025

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/generators/legacy-html/utils/safeCopy.mjs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
'use strict';
22

3-
import { readFile, writeFile, stat } from 'node:fs/promises';
3+
import { readFile, writeFile, stat, readdir } from 'node:fs/promises';
44
import { join } from 'node:path';
55

6-
import { glob } from 'glob';
7-
86
/**
97
* Safely copies files from source to target directory, skipping files that haven't changed
108
* based on file stats (size and modification time)
@@ -13,11 +11,7 @@ import { glob } from 'glob';
1311
* @param {string} targetDir - Target directory path
1412
*/
1513
export async function safeCopy(srcDir, targetDir) {
16-
const files = await glob('*', {
17-
cwd: srcDir,
18-
dot: true,
19-
nodir: true,
20-
});
14+
const files = await readdir(srcDir);
2115

2216
for (const file of files) {
2317
const sourcePath = join(srcDir, file);

0 commit comments

Comments
 (0)