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

Clarify docs for ensureSymlink() when destPath already exists #869

Closed
wants to merge 1 commit into from

Commits on Feb 22, 2021

  1. Clarify docs for ensureSymlink() in the case where destPath already e…

    …xists
    
    The existing docs for `ensureSymlink()` don't specify what happens in the case where `destPath` already exists. Looking at the code it turns out that when `destFile` already exists the function exits without making any modifications, whether or not `destPath` is a symlink to `srcPath`: https://github.com/jprichardson/node-fs-extra/blob/1625838cdfc65a1bbf28ab5fa962a75805629b9c/lib/ensure/symlink.js#L26
    
    I found this behavior surprising, because the function name `ensureSymlink()` sounds like it will ensure that the symlink `destPath -> srcPath` exists. This PR clarifies the existing behavior in the docs.
    mwest1066 committed Feb 22, 2021
    Copy the full SHA
    5b2f6a6 View commit details
    Browse the repository at this point in the history