Skip to content

ls doesn't follow links to directories #733

@nfischer

Description

@nfischer

Originally reported as #446

Node version (or tell us if you're using electron or some other framework):

latest

ShellJS version (the most recent version/Github branch you see the bug on):

Latest. The bug was introduced in v0.7.0

Operating system:

Confirmed on both OS X and Linux.

Description of the bug:

Originally reported in #446. I'm branching this off, since that issue actually discusses two changes.

ls() doesn't follow symlinks pointing to directories, while ls does in Bash.

Example ShellJS command to reproduce the error:

// setup
shell.mkdir('real');
shell.touch('real/file1');
shell.touch('real/file2');
shell.ln('-s', 'real', 'sym');

shell.ls('real');      // file1, file2
shell.ls('sym');       // sym (this is a bug)
shell.exec('ls real'); // file1, file2 (bash behavior)
shell.exec('ls sym');  // file1, file2 (bash behavior)

@freitagbr can you investigate? We should bisect to find the commit that introduced this bug (possibly something from this list). From there, we can figure out how to fix this.

Metadata

Metadata

Assignees

Labels

bash compatCompatibility issues with bash or POSIX behaviorfixBug/defect, or a fix for such a problem

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions