修复 Windows Git hook 测试链接权限
Windows 测试 fixture 使用 junction 创建 node_modules 目录链接 保留 Linux 目录符号链接行为并消除普通权限下的 EPERM
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user