Skip to content

Commit ced95ad

Browse files
committed
only relativise symlinks with an absolute source
1 parent 36d73cc commit ced95ad

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/util/fs.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,12 @@ export async function symlink(src: string, dest: string): Promise<void> {
153153
await fsSymlink(src, dest, "junction");
154154
} else {
155155
// use relative paths otherwise which will be retained if the directory is moved
156-
await fsSymlink(path.relative(path.dirname(dest), src), dest);
156+
let relative = src;
157+
if (path.isAbsolute(relative)) {
158+
relative = path.relative(path.dirname(dest), src);
159+
}
160+
161+
await fsSymlink(relative, dest);
157162
}
158163
} catch (err) {
159164
if (err.code === "EEXIST") {

0 commit comments

Comments
 (0)