Skip to content

Commit 0776985

Browse files
authored
fix: detecting if the existing link is up to date (#63)
ref pnpm/pnpm#9162 close #62
1 parent 2cdb642 commit 0776985

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ async function forceSymlink (
106106
}
107107
}
108108

109-
if (target === linkString) {
109+
if (pathLib.relative(target, linkString) === '') {
110110
return { reused: true }
111111
}
112112
if (opts?.overwrite === false) {
@@ -210,7 +210,7 @@ function forceSymlinkSync (
210210
}
211211
}
212212

213-
if (target === linkString) {
213+
if (pathLib.relative(target, linkString) === '') {
214214
return { reused: true }
215215
}
216216
if (opts?.overwrite === false) {

0 commit comments

Comments
 (0)