Skip to content

Commit

Permalink
Fix using gitignore and absolute options at the same time on Wind…
Browse files Browse the repository at this point in the history
…ows (#137)
  • Loading branch information
rwjblue authored and sindresorhus committed Jan 6, 2020
1 parent c61561a commit 72e775a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gitignore.js
Expand Up @@ -83,7 +83,7 @@ const getFileSync = (file, cwd) => {

const normalizeOptions = ({
ignore = [],
cwd = process.cwd()
cwd = slash(process.cwd())
} = {}) => {
return {ignore, cwd};
};
Expand Down
5 changes: 5 additions & 0 deletions test.js
Expand Up @@ -298,6 +298,11 @@ test('gitignore option with stats option', async t => {
t.false(actual.includes('node_modules'));
});

test('gitignore option with absolute option', async t => {
const result = await globby('*', {gitignore: true, absolute: true});
t.false(result.includes('node_modules'));
});

test('respects gitignore option false - stream', async t => {
const actual = await getStream.array(globby.stream('*', {gitignore: false, onlyFiles: false}));
t.true(actual.includes('node_modules'));
Expand Down

0 comments on commit 72e775a

Please sign in to comment.