File tree Expand file tree Collapse file tree 4 files changed +16
-7
lines changed Expand file tree Collapse file tree 4 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ pub fn run(options: Options) -> std::io::Result<()> {
53
53
trap_dir : options. output_dir ,
54
54
trap_compression : trap:: Compression :: from_env ( "CODEQL_QL_TRAP_COMPRESSION" ) ,
55
55
source_archive_dir : options. source_archive_dir ,
56
- file_list : options. file_list ,
56
+ file_lists : vec ! [ options. file_list] ,
57
57
} ;
58
58
59
59
extractor. run ( )
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ pub struct Extractor {
20
20
pub languages : Vec < LanguageSpec > ,
21
21
pub trap_dir : PathBuf ,
22
22
pub source_archive_dir : PathBuf ,
23
- pub file_list : PathBuf ,
23
+ pub file_lists : Vec < PathBuf > ,
24
24
// Typically constructed via `trap::Compression::from_env`.
25
25
// This allow us to report the error using our diagnostics system
26
26
// without exposing it to consumers.
@@ -74,7 +74,14 @@ impl Extractor {
74
74
. build_global ( )
75
75
. unwrap ( ) ;
76
76
77
- let file_list = File :: open ( & self . file_list ) ?;
77
+ let file_lists: Vec < File > = self
78
+ . file_lists
79
+ . iter ( )
80
+ . map ( |file_list| {
81
+ File :: open ( file_list)
82
+ . unwrap_or_else ( |_| panic ! ( "Unable to open file list at {:?}" , file_list) )
83
+ } )
84
+ . collect ( ) ;
78
85
79
86
let mut schemas = vec ! [ ] ;
80
87
for lang in & self . languages {
@@ -103,8 +110,10 @@ impl Extractor {
103
110
)
104
111
} ;
105
112
106
- let lines: std:: io:: Result < Vec < String > > =
107
- std:: io:: BufReader :: new ( file_list) . lines ( ) . collect ( ) ;
113
+ let lines: std:: io:: Result < Vec < String > > = file_lists
114
+ . iter ( )
115
+ . flat_map ( |file_list| std:: io:: BufReader :: new ( file_list) . lines ( ) )
116
+ . collect ( ) ;
108
117
let lines = lines?;
109
118
110
119
lines
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ fn simple_extractor() {
30
30
languages : vec ! [ language] ,
31
31
trap_dir,
32
32
source_archive_dir,
33
- file_list,
33
+ file_lists : vec ! [ file_list] ,
34
34
trap_compression : Ok ( trap:: Compression :: Gzip ) ,
35
35
} ;
36
36
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ fn multiple_language_extractor() {
39
39
languages : vec ! [ lang_ql, lang_json] ,
40
40
trap_dir,
41
41
source_archive_dir,
42
- file_list,
42
+ file_lists : vec ! [ file_list] ,
43
43
trap_compression : Ok ( trap:: Compression :: Gzip ) ,
44
44
} ;
45
45
You can’t perform that action at this time.
0 commit comments