Skip to content

Commit d519966

Browse files
committed
chore: more simplification
1 parent eed1d8f commit d519966

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,13 @@ export async function safeCopy(srcDir, targetDir) {
1919

2020
const tStat = await stat(targetPath).catch(() => undefined);
2121

22-
// If target doesn't exist, copy immediately
23-
if (!tStat) {
22+
if (tStat === undefined) {
2423
await copyFile(sourcePath, targetPath);
2524
continue;
2625
}
2726

28-
// Target exists, check if we need to update
2927
const sStat = await stat(sourcePath);
3028

31-
// Skip if target has same size and source is not newer
3229
if (sStat.size !== tStat.size || sStat.mtimeMs > tStat.mtimeMs) {
3330
await copyFile(sourcePath, targetPath);
3431
}

0 commit comments

Comments
 (0)