Skip to content

Negation with full path work differently since 6.1.0 #275

@rudywaltz

Description

@rudywaltz

Dear Developers,
I found an inconsistency between 6.0.0 and 6.1.0. We using globby to collect all scss files but not the partial:

import path from 'node:path';
import { globby } from 'globby';

const basePath = path.resolve(import.meta.dirname);

const servicesFilesGlob = await globby([`${basePath}/*.scss`, `!${basePath}/_*`]);
console.log(servicesFilesGlob);

this code have a different result base on version:

6.0.0

[ '/Users/rudywaltz/works/ui-framework-service/test/app.scss' ]

6.1.0

[
  '/Users/rudywaltz/works/ui-framework-service/test/_partial.scss',
  '/Users/rudywaltz/works/ui-framework-service/test/app.scss'
]

I can make a fix if I using the cwd as an option, but it takes time until I figurate out.

import path from 'node:path';
import { globby } from 'globby';

const basePath = path.resolve(import.meta.dirname);

const servicesFilesGlob = await globby([`./*.scss`, `!./_*`], { cwd: basePath });
console.log(servicesFilesGlob);

6.1.0

[ 'app.scss' ]

I just would like to leave it here because maybe it is a potential bug, and for future reference.

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