修复 Windows Git hook 测试链接权限
Project CI / Repository checks (push) Successful in 3m2s
Project CI / Frontend tests (push) Successful in 3m42s
Project CI / Backend tests (push) Successful in 6m17s
Project CI / Native shell tests (push) Successful in 17m51s

Windows 测试 fixture 使用 junction 创建 node_modules 目录链接
保留 Linux 目录符号链接行为并消除普通权限下的 EPERM
This commit is contained in:
2026-09-13 11:46:45 +00:00
parent 6149aaf5f6
commit 637bd90073
+4 -1
View File
@@ -56,7 +56,10 @@ test('pre-commit hook fixes staged imports and formatting without swallowing uns
symlinkSync(
join(repoRoot, 'node_modules'),
join(tempRepo, 'node_modules'),
'dir',
// Windows directory symlinks require an elevated token unless Developer
// Mode is enabled; junctions provide the same fixture semantics without
// that privilege requirement.
process.platform === 'win32' ? 'junction' : 'dir',
);
const sourcePath = join(tempRepo, 'sample.ts');