Skip to content

Commit

Permalink
fix: avoid endless loop when handling symlinks #108
Browse files Browse the repository at this point in the history
  • Loading branch information
q0rban committed Oct 21, 2024
1 parent f9f474b commit b86ff27
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions lib/walker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,16 +317,6 @@ function stepDetect(
}
}

function findCommonJunctionPoint(file: string, realFile: string) {
// find common denominator => where the link changes
while (toNormalizedRealPath(path.dirname(file)) === path.dirname(realFile)) {
file = path.dirname(file);
realFile = path.dirname(realFile);
}

return { file, realFile };
}

export interface WalkerParams {
publicToplevel?: boolean;
publicPackages?: string[];
Expand Down Expand Up @@ -400,10 +390,6 @@ class Walker {
}

appendSymlink(file: string, realFile: string) {
const a = findCommonJunctionPoint(file, realFile);
file = a.file;
realFile = a.realFile;

if (!this.symLinks[file]) {
const dn = path.dirname(file);
this.appendFileInFolder({
Expand Down

0 comments on commit b86ff27

Please sign in to comment.