8000 Checking for changes used to fail after a 'npm i ../../ --save' for i… · NativeScript/nativescript-cli@0b66b82 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0b66b82

Browse files
PanayotCankovKristianDD
authored andcommitted
Checking for changes used to fail after a 'npm i ../../ --save' for installing plugins into apps recursively
1 parent a02f9c2 commit 0b66b82

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/services/project-changes-service.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,15 @@ export class ProjectChangesService implements IProjectChangesService {
220220
return false;
221221
}
222222

223-
private containsNewerFiles(dir: string, skipDir: string, projectData: IProjectData, processFunc?: (filePath: string, projectData: IProjectData) => boolean): boolean {
223+
private containsNewerFiles(dir: string, skipDir: string, projectData: IProjectData, processFunc?: (filePath: string, projectData: IProjectData) => boolean, visitedRealPaths?: Set<string>): boolean {
224+
225+
visitedRealPaths = visitedRealPaths || new Set<string>();
226+
227+
const dirRPath = this.$fs.realpath(dir);
228+
if (visitedRealPaths.has(dirRPath)) {
229+
return false;
230+
}
231+
visitedRealPaths.add(dirRPath);
224232

225233
const dirName = path.basename(dir);
226234
if (_.startsWith(dirName, '.')) {
@@ -255,7 +263,7 @@ export class ProjectChangesService implements IProjectChangesService {
255263
}
256264

257265
if (fileStats.isDirectory()) {
258-
if (this.containsNewerFiles(filePath, skipDir, projectData, processFunc)) {
266+
if (this.containsNewerFiles(filePath, skipDir, projectData, processFunc, visitedRealPaths)) {
259267
return true;
260268
}
261269
}

0 commit comments

Comments
 (0)
0