Skip to content

Commit a72ecda

Browse files
authored
Reverts #2454 (#6321)
* Reverts #2454 * Update fs.js
1 parent 83bd87e commit a72ecda

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/util/fs.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -696,15 +696,7 @@ export async function symlink(src: string, dest: string): Promise<void> {
696696
await fsSymlink(src, dest, 'junction');
697697
} else {
698698
// use relative paths otherwise which will be retained if the directory is moved
699-
let relative;
700-
try {
701-
relative = path.relative(fs.realpathSync(path.dirname(dest)), fs.realpathSync(src));
702-
} catch (err) {
703-
if (err.code !== 'ENOENT') {
704-
throw err;
705-
}
706-
relative = path.relative(path.dirname(dest), src);
707-
}
699+
const relative = path.relative(path.dirname(dest), src);
708700
// When path.relative returns an empty string for the current directory, we should instead use
709701
// '.', which is a valid fs.symlink target.
710702
await fsSymlink(relative || '.', dest);

0 commit comments

Comments
 (0)