Skip to content

Commit

Permalink
revert resolution of symbolic links due to #54
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperchupuDev committed Oct 1, 2024
1 parent b76f971 commit 1f1fa12
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ globSync(['src/**/*.ts'], { ignore: ['**/*.d.ts'] });
- `absolute`: Whether to return absolute paths. Defaults to `false`.
- `dot`: Whether to allow entries starting with a dot. Defaults to `false`.
- `deep`: Maximum depth of a directory. Defaults to `Infinity`.
- `followSymbolicLinks`: Whether to traverse and include symbolic links. Defaults to `true`.
- `followSymbolicLinks`: Whether to traverse and include symbolic links. Defaults to `true`. (TEMP DISABLED due to critical bug)
- `caseSensitiveMatch`: Whether to match in case-sensitive mode. Defaults to `true`.
- `expandDirectories`: Whether to expand directories. Disable to best match `fast-glob`. Defaults to `true`.
- `onlyDirectories`: Enable to only return directories. Disables `onlyFiles` if set. Defaults to `false`.
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ function crawl(options: GlobOptions, cwd: string, sync: boolean) {
filters: [(p, isDirectory) => matcher(processPath(p, cwd, properties.root, isDirectory, options.absolute))],
exclude: (_, p) => exclude(processPath(p, cwd, properties.root, true, true)),
pathSeparator: '/',
relativePaths: true,
resolveSymlinks: true
relativePaths: true
// resolveSymlinks: true
};

if (options.deep) {
Expand Down
9 changes: 7 additions & 2 deletions test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,17 @@ test('absolute + empty commonPath', async () => {
assert.deepEqual(files.sort(), [`${cwd.replaceAll('\\', '/')}a/a.txt`, `${cwd.replaceAll('\\', '/')}a/b.txt`]);
});

test('handle symlinks', async () => {
test('do NOT handle symlinks for now', async () => {
const files = await glob({ patterns: ['.symlink/**'], dot: true, cwd });
assert.deepEqual(files.sort(), ['.symlink/dir', '.symlink/file']);
});

test.skip('handle symlinks', async () => {
const files = await glob({ patterns: ['.symlink/**'], dot: true, cwd });
assert.deepEqual(files.sort(), ['.symlink/dir/a.txt', '.symlink/dir/b.txt', '.symlink/file']);
});

test('handle symlinks (absolute)', async () => {
test.skip('handle symlinks (absolute)', async () => {
const files = await glob({ patterns: ['.symlink/**'], dot: true, absolute: true, cwd });
assert.deepEqual(files.sort(), [
`${cwd.replaceAll('\\', '/')}.symlink/dir/a.txt`,
Expand Down

0 comments on commit 1f1fa12

Please sign in to comment.