Skip to content

File paths are always relative to the current directory unlike folders #77

@SnirBroshi

Description

@SnirBroshi

Reproduction:

Create the following file structure:

a/
    b/
    c.txt

And run the following testcases inside the a/ folder:

glob('../a/*') //=> ['../a/b', 'c.txt']
glob('b/../*') //=> ['b', 'c.txt']
glob('/absolute/path/to/a/*') //=> ['/absolute/path/to/a/b', 'c.txt']

The paths to files are always relative to the current directory, while the paths to folders are somewhat faithful to the glob input.

I think the correct form is to stay faithful to the input, but whatever the choice is the inconsistencies are a problem.

I also think it's weird that even for folders b/.. resolves to nothing while ../a stays as-is, but it kinda makes sense since for the latter you need to know the current folder is a.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions