Skip to content

Commit c290940

Browse files
committed
fix: update globby to latest version
1 parent 0a3ed26 commit c290940

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

lib/glob-assets.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ const dirGlob = require('dir-glob');
55
const globby = require('globby');
66
const debug = require('debug')('semantic-release:github');
77

8-
const filesTransform = (files, cwd, transform) =>
9-
files.map(file => `${file.startsWith('!') ? '!' : ''}${transform(cwd, file.startsWith('!') ? file.slice(1) : file)}`);
10-
118
module.exports = async ({cwd}, assets) =>
129
uniqWith(
1310
[]
@@ -16,11 +13,9 @@ module.exports = async ({cwd}, assets) =>
1613
assets.map(async asset => {
1714
// Wrap single glob definition in Array
1815
let glob = castArray(isPlainObject(asset) ? asset.path : asset);
19-
// TODO Temporary workaround for https://github.com/kevva/dir-glob/issues/7 and https://github.com/mrmlnc/fast-glob/issues/47
20-
glob = uniq([
21-
...filesTransform(await dirGlob(filesTransform(glob, cwd, path.resolve)), cwd, path.relative),
22-
...glob,
23-
]);
16+
17+
// TODO Temporary workaround for https://github.com/mrmlnc/fast-glob/issues/47
18+
glob = uniq([...(await dirGlob(glob, {cwd})), ...glob]);
2419

2520
// Skip solo negated pattern (avoid to include every non js file with `!**/*.js`)
2621
if (glob.length <= 1 && glob[0].startsWith('!')) {
@@ -33,7 +28,7 @@ module.exports = async ({cwd}, assets) =>
3328

3429
const globbed = await globby(glob, {
3530
cwd,
36-
expandDirectories: true,
31+
expandDirectories: false, // TODO Temporary workaround for https://github.com/mrmlnc/fast-glob/issues/47
3732
gitignore: false,
3833
dot: true,
3934
onlyFiles: false,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"debug": "^4.0.0",
2424
"dir-glob": "^2.0.0",
2525
"fs-extra": "^7.0.0",
26-
"globby": "^8.0.0",
26+
"globby": "^9.0.0",
2727
"http-proxy-agent": "^2.1.0",
2828
"https-proxy-agent": "^2.2.1",
2929
"issue-parser": "^3.0.0",

test/glob-assets.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,5 +189,5 @@ test('Deduplicate resulting files path', async t => {
189189
await copy(fixtures, cwd);
190190
const globbedAssets = await globAssets({cwd}, ['./upload.txt', path.resolve(cwd, 'upload.txt'), 'upload.txt']);
191191

192-
t.deepEqual(globbedAssets, ['upload.txt']);
192+
t.is(globbedAssets.length, 1);
193193
});

0 commit comments

Comments
 (0)