| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -52,7 +52,7 @@ const getIsIgnoredPredicate = (files, cwd) => { | |||
| 52 | 52 | return fileOrDirectory => { | |
| 53 | 53 | fileOrDirectory = toPath(fileOrDirectory); | |
| 54 | 54 | fileOrDirectory = toRelativePath(fileOrDirectory, cwd); | |
| 55 | - return ignores.ignores(slash(fileOrDirectory)); | ||
| 55 | + return fileOrDirectory ? ignores.ignores(slash(fileOrDirectory)) : false; | ||
| 56 | 56 | }; | |
| 57 | 57 | }; | |
| 58 | 58 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -190,6 +190,19 @@ test('expandDirectories and ignores option', async t => { | |||
| 190 | 190 | }), ['tmp/a.tmp', 'tmp/b.tmp', 'tmp/c.tmp', 'tmp/d.tmp', 'tmp/e.tmp']); | |
| 191 | 191 | }); | |
| 192 | 192 | ||
| 193 | + test('absolute:true, expandDirectories:false, onlyFiles:false, gitignore:true and top level folder', async t => { | ||
| 194 | + const result = await runGlobby(t, '.', { | ||
| 195 | + absolute: true, | ||
| 196 | + cwd: path.resolve(temporary), | ||
| 197 | + expandDirectories: false, | ||
| 198 | + gitignore: true, | ||
| 199 | + onlyFiles: false, | ||
| 200 | + }); | ||
| 201 | + | ||
| 202 | + t.is(result.length, 1); | ||
| 203 | + t.truthy(result[0].endsWith(temporary)); | ||
| 204 | + }); | ||
| 205 | + | ||
| 193 | 206 | test.serial.failing('relative paths and ignores option', async t => { | |
| 194 | 207 | process.chdir(temporary); | |
| 195 | 208 | for (const cwd of getPathValues(process.cwd())) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments