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

Upgrade ignore package #120

Merged
merged 1 commit into from Jun 14, 2019
Merged

Conversation

jamiekyle-eb
Copy link
Contributor

Resolves #92

path.relative(from, to) is weird when you have an absolute path and a relative path. By normalizing p to path.join(cwd, p) to get an absolute path it works.

I added some additional guards here just to be really safe about it:

  • If p is already an absolute path:
    • Assert that it is in cwd and return it
  • Otherwise, path.join(cwd, p)

I don't know if these cases will actually come up, but it seemed better to give a specific error message and guard it a bit more.

@sindresorhus sindresorhus changed the title Upgrade ignore package Upgrade ignore package Jun 14, 2019
@sindresorhus sindresorhus merged commit 04d51bf into sindresorhus:master Jun 14, 2019
@fisker fisker mentioned this pull request Feb 26, 2020
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update ignore package to latest version
3 participants