Skip to content

Commit

Permalink
Reverts #2454
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanis authored Aug 28, 2018
1 parent 2f89339 commit dd218ce
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/util/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -696,15 +696,7 @@ export async function symlink(src: string, dest: string): Promise<void> {
await fsSymlink(src, dest, 'junction');
} else {
// use relative paths otherwise which will be retained if the directory is moved
let relative;
try {
relative = path.relative(fs.realpathSync(path.dirname(dest)), fs.realpathSync(src));
} catch (err) {
if (err.code !== 'ENOENT') {
throw err;
}
relative = path.relative(path.dirname(dest), src);
}
let relative = path.relative(path.dirname(dest), src);
// When path.relative returns an empty string for the current directory, we should instead use
// '.', which is a valid fs.symlink target.
await fsSymlink(relative || '.', dest);
Expand Down

0 comments on commit dd218ce

Please sign in to comment.