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 using gitignore and absolute options at the same time on Windows #137

Merged
merged 1 commit into from Jan 6, 2020

Commits on Oct 16, 2019

  1. Ensure defaulted process.cwd() has been corrected to posix paths.

    When `globby` is invoked with `globby('*', { absolute: true, gitignore: true
    })` on Windows systems, the assertion added in
    4af038e **always** triggers. This is
    because when we default the `cwd` in `normalizeOptions`, we didn't
    convert from `C:\\` style paths to forward slashes.
    
    The test added here was failing on Windows, example output prior to the
    fixes:
    
    ```
      test » gitignore option with absolute option
      C:\Users\travis\build\rwjblue\globby\gitignore.js:52
       51:
       52:     throw new Error(`Path ${p} is not in cwd ${cwd}`);
       53:   }
      Rejected promise returned by test. Reason:
      Error {
        message: 'Path C:/Users/travis/build/rwjblue/globby/a.tmp is not in cwd C:\\Users\\travis\\build\\rwjblue\\globby',
      }
    ```
    rwjblue committed Oct 16, 2019
    Copy the full SHA
    9d8d30a View commit details
    Browse the repository at this point in the history