File tree Expand file tree Collapse file tree 1 file changed +1
-9
lines changed Expand file tree Collapse file tree 1 file changed +1
-9
lines changed Original file line number Diff line number Diff line change @@ -696,15 +696,7 @@ export async function symlink(src: string, dest: string): Promise<void> {
696
696
await fsSymlink ( src , dest , 'junction' ) ;
697
697
} else {
698
698
// 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 ) ;
708
700
// When path.relative returns an empty string for the current directory, we should instead use
709
701
// '.', which is a valid fs.symlink target.
710
702
await fsSymlink ( relative || '.' , dest ) ;
You can’t perform that action at this time.
0 commit comments