Visitar URL original
`shelljs.find` doesn't return contents of a dir on windows · Issue #1227 · shelljs/shelljs · GitHub
Skip to content

shelljs.find doesn't return contents of a dir on windows #1227

Description

@cristiand391

Repro: https://github.com/cristiand391/shelljs-find-windows-bug

I put a dummy project dir for testing:

project/
└── source
    └── index.js

shelljs.find used to return the contents of the dir (recursive read):
https://github.com/cristiand391/shelljs-find-windows-bug/blob/db712a1b83e66ed005e78893e7b480d58175f66c/test.js#L5

this works on linux and windows when using shelljs v0.8.5 but fails on windows after updating to v0.9.0 or higher:

CI runs:

✅ v0.8.5 linux
✅ v0.8.5 windows:
https://github.com/cristiand391/shelljs-find-windows-bug/actions/runs/16007671602

✅ v.0.9.0 linux
❌ v0.9.0 windows:
https://github.com/cristiand391/shelljs-find-windows-bug/actions/runs/16007821671

only 1 filepath was returned:
Image

✅ v0.10.0 linux
❌ v0.10.0 windows
https://github.com/cristiand391/shelljs-find-windows-bug/actions/runs/16007701904

only 1 filepath was returned:
Image

Activity

  1. cristiand391 commented on Jul 1, 2025

    @cristiand391
    Author

    I spent some time looking at the changes between 0.8.5 and 0.9.0 but don't see any in find.js, could be ls.js and the swap in glob dependency but don't have my windows machine right now for more testing. Will post here if I find something.

  2. nfischer commented on Jul 2, 2025

    @nfischer
    Member

    It's possible that the glob change affected this. Do you think you would be able to write a unit test (as a PR for the shelljs/shelljs repo) which would assert the correct behavior? If you can do that then I can see if I can change the glob expression to do the right thing on Windows.

  3. added
    fixBug/defect, or a fix for such a problem
    on Jul 2, 2025
  4. cristiand391 commented on Jul 2, 2025

    @cristiand391
    Author

    Do you think you would be able to write a unit test (as a PR for the shelljs/shelljs repo) which would assert the correct behavior?

    sure, will do it tomorrow 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixBug/defect, or a fix for such a problemglob

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions