1- const path = require ( 'path' ) ;
21const { isPlainObject, castArray, uniq} = require ( 'lodash' ) ;
32const dirGlob = require ( 'dir-glob' ) ;
43const globby = require ( 'globby' ) ;
54const 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-
106module . 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 ,
0 commit comments