test: fix several bazel compiler-cli tests in windows (#30189)
``` //packages/compiler-cli/integrationtest:integrationtest //packages/compiler-cli/test/compliance:compliance ``` Partially addresses #29785 PR Close #30189
This commit is contained in:
@ -98,13 +98,8 @@ function symlinkNodeModules() {
|
||||
Object.keys(requiredNodeModules).forEach(importName => {
|
||||
const outputPath = path.join(tmpDir, 'node_modules', importName);
|
||||
const moduleDir = requiredNodeModules[importName];
|
||||
|
||||
findFilesWithinDirectory(moduleDir).forEach(filePath => {
|
||||
const outputFilePath = path.join(outputPath, path.relative(moduleDir, filePath));
|
||||
|
||||
shx.mkdir('-p', path.dirname(outputFilePath));
|
||||
fs.symlinkSync(filePath, outputFilePath);
|
||||
});
|
||||
shx.mkdir('-p', path.dirname(outputPath));
|
||||
fs.symlinkSync(moduleDir, outputPath, 'junction');
|
||||
});
|
||||
}
|
||||
|
||||
@ -162,5 +157,5 @@ function resolveNpmTreeArtifact(manifestPath, resolveFile = 'package.json') {
|
||||
|
||||
/** Finds all files within a specified directory. */
|
||||
function findFilesWithinDirectory(directoryPath) {
|
||||
return shx.find(directoryPath).filter(filePath => !fs.statSync(filePath).isDirectory());
|
||||
return shx.find(directoryPath).filter(filePath => !fs.lstatSync(filePath).isDirectory());
|
||||
}
|
||||
|
Reference in New Issue
Block a user