E3FE node-glob update · Issue #1293 · clean-css/clean-css · GitHub
[go: up one dir, main page]

Skip to content

node-glob update #1293

@kapouer

Description

@kapouer

To anyone interested, this ensures tries to keep behavior as close as possible, yet still use node-glob 10:

--- a/cli/index.js
+++ b/cli/index.js
@@ -215,11 +215,11 @@
   var ignoredGlobPatterns = paths
     .filter(function (path) { return path[0] == '!'; })
     .map(function (path) { return path.substring(1); });
-
   return globPatterns.reduce(function (accumulator, path) {
     var expandedWithSource =
-      glob.sync(path, { ignore: ignoredGlobPatterns, nodir: true, nonull: true })
-      .map(function (expandedPath) { return { expanded: expandedPath, source: path }; });
+      glob.sync(path, { ignore: ignoredGlobPatterns, nodir: true, dotRelative: true });
+    if (expandedWithSource.length == 0) expandedWithSource.push(path);
+    expandedWithSource = expandedWithSource.map(function (expandedPath) { return { expanded: expandedPath, source: path }; });

     return accumulator.concat(expandedWithSource);
   }, []);

The "cli/test/binary-test.js" batch processing with wildcard and exclude paths test seems to be using a deprecated feature of node glob (! with slash in pattern), so there's no simple workaround for that test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0