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

Patterns using parent directories (../) ignore { nodir: true } option #312

Closed
benbroadley88 opened this issue Sep 30, 2019 · 1 comment
Closed

Comments

@benbroadley88
Copy link

I'm just in the process of upgrading from Gulp v3.9.1 to v4.0.2 and I've run into an issue with glob patterns - it's rather similar to #306 but I think the circumstances are slightly different so wanted to report it separately just in case. Please feel free to close this if you think they are in fact the same issue.

What were you expecting to happen?
When setting the { nodir: true } option in gulp.src(), if the glob path contains a parent directory selector (i.e. ../) then directories are included regardless of the specified option.

What actually happened?
Given the following directory/file structure

├──a
│  │-a.txt
│  └───b
│      │-b.txt
│      └───c
│          │-c.txt
│          └───d
│              │-d.txt
│-gulpfile.js

gulp.src('a/b/../**/*', { nodir: true }) will return 5 items (3 .txt files and 2 directories) even though it is told not to include directories and should therefore only include 3 items.

Please post a sample of your gulpfile (preferably reduced to just the bit that's not working)

const gulp = require('gulp');
const debug = require('gulp-debug');

function defaultTask(cb) {
    gulp.src('a/b/../**/*', { nodir: true })
        .pipe(debug());

    cb();
}

exports.default = defaultTask;

What version of gulp are you using?
v4.0.2 (previously v3.9.1)

What versions of npm and node are you using?
npm -v 6.9.0
node -v 10.16.0

@phated
Copy link
Member

phated commented Jun 11, 2023

We've dropped the node-glob dependency inside of glob-stream so there is no more nodir option. That being said, we don't support . or .. in the middle of globs so you should resolve them before you pass them to src.

@phated phated closed this as not planned Won't fix, can't repro, duplicate, stale Jun 11, 2023
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