Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

del 5.0.0 not finding files in Windows #93

Closed
aarongoldenthal opened this issue Jul 4, 2019 · 2 comments
Closed

del 5.0.0 not finding files in Windows #93

aarongoldenthal opened this issue Jul 4, 2019 · 2 comments

Comments

@aarongoldenthal
Copy link

aarongoldenthal commented Jul 4, 2019

System configuration:

  • Windows 10 version 1809
  • Node: v12.5.0

I upgraded a project today from del 4.1.1 to 5.0.0 and noticed that no files were being deleted with the following:

    const testDir = './tests/test-cases';
    del.sync([path.join(testDir, '*.html')]);

This has previously run nominally on both Windows and Linux. I tried using dry run with various options and no files were identified. I ultimately tried

    del.sync([path.join(process.cwd(), '**')], {dryRun: true});

to find anything, but it returned no files (although there are 12680 files).

I ran the same code on Linux in Node Docker containers, both latest (Node: v12.5.0), and LTS (Node v10.16.0), and everything was nominal (files deleted as expected, dry run showed expected files).

@sindresorhus
Copy link
Owner

Glob patterns can now only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use path.posix.join() instead of path.join().

This change is because of a change in fast-glob to allow escaping glob patterns: https://github.com/mrmlnc/fast-glob/releases/tag/3.0.0

@sindresorhus
Copy link
Owner

It is in the release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants