File: glob-10-compat.patch

package info (click to toggle)
node-clean-css 5.3.3%2B~5.6.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,928 kB
  • sloc: javascript: 42,587; sh: 5; makefile: 4
file content (48 lines) | stat: -rw-r--r-- 2,390 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Description: Try to keep up with glob 10
Last-Update: 2025-11-23
Author: Jérémy Lal <kapouer@melix.org>
Forwarded: https://github.com/clean-css/clean-css/issues/1293
--- 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);
   }, []);
--- a/cli/test/binary-test.js
+++ b/cli/test/binary-test.js
@@ -867,24 +867,6 @@
     })
   })
   .addBatch({
-    'batch processing with wildcard and exclude paths': binaryContext('-b ./test/fixtures-batch-5/partials/\\*\\*/*.css !./test/fixtures-batch-5/partials/one* !./test/fixtures-batch-5/partials/fiv?.css', {
-      'setup': function () {
-        execSync('cp -fr test/fixtures test/fixtures-batch-5');
-      },
-      'creates two separate minified files': function () {
-        assert.isTrue(fs.existsSync('test/fixtures-batch-5/partials/extra/four-min.css'));
-        assert.isTrue(fs.existsSync('test/fixtures-batch-5/partials/extra/three-min.css'));
-        assert.isFalse(fs.existsSync('test/fixtures-batch-5/partials/one-min.css'));
-        assert.isTrue(fs.existsSync('test/fixtures-batch-5/partials/two-min.css'));
-        assert.isTrue(fs.existsSync('test/fixtures-batch-5/partials/quoted-svg-min.css'));
-        assert.isFalse(fs.existsSync('test/fixtures-batch-5/partials/five-min.css'));
-      },
-      'teardown': function () {
-        execSync('rm -fr test/fixtures-batch-5');
-      }
-    })
-  })
-  .addBatch({
     'batch processing with output as a path': binaryContext('-b ./test/fixtures-batch-6/partials/\\*\\*/*.css -o test/fixtures-batch-6-output', {
       'setup': function () {
         execSync('cp -fr test/fixtures test/fixtures-batch-6');