diff --git a/lib/glob-assets.js b/lib/glob-assets.js index fd0b5c0c..1a760560 100644 --- a/lib/glob-assets.js +++ b/lib/glob-assets.js @@ -1,12 +1,8 @@ -const path = require('path'); const {isPlainObject, castArray, uniq} = require('lodash'); const dirGlob = require('dir-glob'); const globby = require('globby'); const debug = require('debug')('semantic-release:github'); -const filesTransform = (files, cwd, transform) => - files.map(file => `${file.startsWith('!') ? '!' : ''}${transform(cwd, file.startsWith('!') ? file.slice(1) : file)}`); - module.exports = async ({cwd}, assets) => uniq( [].concat( @@ -14,11 +10,8 @@ module.exports = async ({cwd}, assets) => assets.map(async asset => { // Wrap single glob definition in Array let glob = castArray(isPlainObject(asset) ? asset.path : asset); - // TODO Temporary workaround for https://github.com/kevva/dir-glob/issues/7 and https://github.com/mrmlnc/fast-glob/issues/47 - glob = uniq([ - ...filesTransform(await dirGlob(filesTransform(glob, cwd, path.resolve)), cwd, path.relative), - ...glob, - ]); + // TODO Temporary workaround for https://github.com/mrmlnc/fast-glob/issues/47 + glob = uniq([...(await dirGlob(glob, {cwd})), ...glob]); // Skip solo negated pattern (avoid to include every non js file with `!**/*.js`) if (glob.length <= 1 && glob[0].startsWith('!')) { @@ -31,7 +24,7 @@ module.exports = async ({cwd}, assets) => const globbed = await globby(glob, { cwd, - expandDirectories: true, + expandDirectories: false, // TODO Temporary workaround for https://github.com/mrmlnc/fast-glob/issues/47 gitignore: false, dot: true, onlyFiles: false, diff --git a/package.json b/package.json index 6211b881..25041458 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "dir-glob": "^2.0.0", "execa": "^1.0.0", "fs-extra": "^7.0.0", - "globby": "^8.0.1", + "globby": "^9.0.0", "lodash": "^4.17.4", "micromatch": "^3.1.4", "p-reduce": "^1.0.0"