From 4bdd5d5ce21147d67a46b6d2e1ec65007b31705c Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Wed, 20 Apr 2022 19:56:15 -0700 Subject: [PATCH] fix: normalize win32 paths before globbing --- lib/verify.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/verify.js b/lib/verify.js index 300cd9f..a39fb6c 100644 --- a/lib/verify.js +++ b/lib/verify.js @@ -13,6 +13,8 @@ const path = require('path') const rimraf = util.promisify(require('rimraf')) const ssri = require('ssri') +const globify = pattern => pattern.split('\\').join('/') + const hasOwnProperty = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key) @@ -119,7 +121,7 @@ function garbageCollect (cache, opts) { indexStream.on('end', resolve).on('error', reject) }).then(() => { const contentDir = contentPath.contentDir(cache) - return glob(path.join(contentDir, '**'), { + return glob(globify(path.join(contentDir, '**')), { follow: false, nodir: true, nosort: true,