Skip to content

Commit 9e2b2e5

Browse files
committedJan 14, 2019
fix: update globby to latest version
1 parent 3eb8f60 commit 9e2b2e5

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed
 

Diff for: ‎lib/glob-assets.js

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
1-
const path = require('path');
21
const {isPlainObject, castArray, uniq} = require('lodash');
32
const dirGlob = require('dir-glob');
43
const globby = require('globby');
54
const debug = require('debug')('semantic-release:github');
65

7-
const filesTransform = (files, cwd, transform) =>
8-
files.map(file => `${file.startsWith('!') ? '!' : ''}${transform(cwd, file.startsWith('!') ? file.slice(1) : file)}`);
9-
106
module.exports = async ({cwd}, assets) =>
117
uniq(
128
[].concat(
139
...(await Promise.all(
1410
assets.map(async asset => {
1511
// Wrap single glob definition in Array
1612
let glob = castArray(isPlainObject(asset) ? asset.path : asset);
17-
// TODO Temporary workaround for https://github.com/kevva/dir-glob/issues/7 and https://github.com/mrmlnc/fast-glob/issues/47
18-
glob = uniq([
19-
...filesTransform(await dirGlob(filesTransform(glob, cwd, path.resolve)), cwd, path.relative),
20-
...glob,
21-
]);
13+
// TODO Temporary workaround for https://github.com/mrmlnc/fast-glob/issues/47
14+
glob = uniq([...(await dirGlob(glob, {cwd})), ...glob]);
2215

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

3225
const globbed = await globby(glob, {
3326
cwd,
34-
expandDirectories: true,
27+
expandDirectories: false, // TODO Temporary workaround for https://github.com/mrmlnc/fast-glob/issues/47
3528
gitignore: false,
3629
dot: true,
3730
onlyFiles: false,

Diff for: ‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"dir-glob": "^2.0.0",
2323
"execa": "^1.0.0",
2424
"fs-extra": "^7.0.0",
25-
"globby": "^8.0.1",
25+
"globby": "^9.0.0",
2626
"lodash": "^4.17.4",
2727
"micromatch": "^3.1.4",
2828
"p-reduce": "^1.0.0"

0 commit comments

Comments
 (0)
Please sign in to comment.