fix(workspace): harden omo migration review issues

This commit is contained in:
YeonGyu-Kim
2026-05-16 18:02:54 +09:00
parent 82ec099c3a
commit 240a4a17ad
7 changed files with 91 additions and 10 deletions
+8 -3
View File
@@ -1,4 +1,4 @@
import { copyFileSync, existsSync, mkdirSync, readdirSync, statSync } from "node:fs"
import { copyFileSync, existsSync, lstatSync, mkdirSync, readdirSync } from "node:fs"
import { dirname, join, relative } from "node:path"
import { log } from "./logger"
@@ -12,10 +12,15 @@ export type LegacyWorkspaceMigrationResult = {
}
function copyMissingEntries(legacyPath: string, targetPath: string, targetRoot: string, skipped: string[]): boolean {
const legacyStat = statSync(legacyPath)
const legacyStat = lstatSync(legacyPath)
if (legacyStat.isSymbolicLink()) {
skipped.push(join(WORKSPACE_DIR, relative(targetRoot, targetPath)))
return false
}
if (existsSync(targetPath)) {
if (legacyStat.isDirectory() && statSync(targetPath).isDirectory()) {
if (legacyStat.isDirectory() && lstatSync(targetPath).isDirectory()) {
let copiedChild = false
for (const entry of readdirSync(legacyPath)) {
copiedChild = copyMissingEntries(join(legacyPath, entry), join(targetPath, entry), targetRoot, skipped) || copiedChild