We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 495900a commit e4344a4Copy full SHA for e4344a4
src/util/fs.js
@@ -419,7 +419,12 @@ export async function symlink(src: string, dest: string): Promise<void> {
419
await fsSymlink(src, dest, 'junction');
420
} else {
421
// use relative paths otherwise which will be retained if the directory is moved
422
- const relative = path.relative(fs.realpathSync(path.dirname(dest)), fs.realpathSync(src));
+ let relative;
423
+ if (await exists(src)) {
424
+ relative = path.relative(fs.realpathSync(path.dirname(dest)), fs.realpathSync(src));
425
+ } else {
426
+ relative = path.relative(path.dirname(dest), src);
427
+ }
428
await fsSymlink(relative, dest);
429
}
430
} catch (err) {
0 commit comments