Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Ensure valid target passed to fs.symlink (refs #3276) #3946

Merged
merged 1 commit into from Jul 19, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/util/fs.js
Expand Up @@ -725,7 +725,9 @@ export async function symlink(src: string, dest: string): Promise<void> {
} else {
relative = path.relative(path.dirname(dest), src);
}
await fsSymlink(relative, dest);
// 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);
}
} catch (err) {
if (err.code === 'EEXIST') {
Expand Down