File tree 2 files changed +13
-13
lines changed
2 files changed +13
-13
lines changed Original file line number Diff line number Diff line change 11
11
runs-on : ubuntu-latest
12
12
strategy :
13
13
matrix :
14
- node : [18 , 20, 22]
14
+ node : ['18.16.0' , 20, 22]
15
15
name : Node ${{ matrix.node }}
16
16
steps :
17
17
- uses : actions/checkout@v4
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import crypto from 'crypto';
3
3
import fs from 'fs' ;
4
4
import path from 'path' ;
5
5
6
+ import { glob } from 'glob' ;
6
7
import Archiver from 'archiver' ;
7
8
8
9
import validateArchive from './validateArchive' ;
@@ -22,20 +23,19 @@ async function resolveFilesRecursiveForDir(dirOrFile) {
22
23
const isDir = ( await fs . promises . lstat ( resolvedDirOrFile ) ) . isDirectory ( ) ;
23
24
24
25
if ( isDir ) {
25
- const files = await fs . promises . readdir ( resolvedDirOrFile , {
26
- withFileTypes : true ,
27
- recursive : true ,
26
+ const files = await glob ( '**/*' , {
27
+ cwd : resolvedDirOrFile ,
28
+ nodir : true ,
29
+ absolute : true ,
30
+ dot : true ,
28
31
} ) ;
29
32
30
- return files
31
- . filter ( ( dirent ) => dirent . isFile ( ) )
32
- . map ( ( dirent ) => {
33
- const fullPath = path . join ( dirent . path , dirent . name ) ;
34
- return {
35
- name : fullPath . slice ( resolvedDirOrFile . length + 1 ) ,
36
- stream : fs . createReadStream ( fullPath ) ,
37
- } ;
38
- } ) ;
33
+ return files . map ( ( fullPath ) => {
34
+ return {
35
+ name : path . relative ( resolvedDirOrFile , fullPath ) ,
36
+ stream : fs . createReadStream ( fullPath ) ,
37
+ } ;
38
+ } ) ;
39
39
}
40
40
41
41
return [
You can’t perform that action at this time.
0 commit comments