From: =?utf-8?q?Bastien_Roucari=C3=A8s?= <rouca@debian.org>
Date: Sun, 2 Nov 2025 17:05:54 +0100
Subject: Use glob@8

forwarded: not-needed
---
 bin/args.js | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/bin/args.js b/bin/args.js
index 130ace7..030ad58 100644
--- a/bin/args.js
+++ b/bin/args.js
@@ -6,6 +6,8 @@ var insertGlobals = require('insert-module-globals');
 var duplexer = require('duplexer2');
 var subarg = require('subarg');
 var glob = require('glob');
+const { version: globversion } = require('glob/package.json');
+const globversion8 = (parseInt(globversion.split('.')[0], 10) < 9)
 var Readable = require('readable-stream').Readable;
 var xtend = require('xtend');
 
@@ -124,7 +126,8 @@ module.exports = function (args, opts) {
     [].concat(argv.ignore).filter(Boolean)
         .forEach(function (i) {
             b._pending ++;
-            glob(i, function (err, files) {
+            if(globversion8) {
+              glob(i, function (err, files) {
                 if (err) return b.emit('error', err);
                 if (files.length === 0) {
                   b.ignore(i);
@@ -134,6 +137,24 @@ module.exports = function (args, opts) {
                 }
                 if (--b._pending === 0) b.emit('_ready');
             });
+            } else {
+	      glob(i)
+		.then(files => {
+		    if (files.length === 0) {
+			b.ignore(i);
+		    } else {
+			files.forEach(file => b.ignore(file));
+		    }
+		})
+		.catch(err => {
+		    b.emit('error', err);
+		})
+		.finally(() => {
+		    if (--b._pending === 0) {
+			b.emit('_ready');
+		    }
+		});
+             }
         })
     ;
     
