@@ -4,6 +4,7 @@ use std::env;
4
4
use std:: fs:: { self , File } ;
5
5
use std:: io:: { BufWriter , Write } ;
6
6
use std:: path:: PathBuf ;
7
+ use std:: str:: FromStr ;
7
8
use std:: sync:: mpsc:: channel;
8
9
use std:: sync:: Arc ;
9
10
use std:: thread:: spawn;
@@ -38,6 +39,7 @@ use rari_tools::sync_translated_content::sync_translated_content;
38
39
use rari_types:: globals:: { build_out_root, content_root, content_translated_root, SETTINGS } ;
39
40
use rari_types:: locale:: Locale ;
40
41
use rari_types:: settings:: Settings ;
42
+ use rari_utils:: io:: read_to_string;
41
43
use schemars:: schema_for;
42
44
use self_update:: cargo_crate_version;
43
45
use tabwriter:: TabWriter ;
@@ -169,6 +171,8 @@ struct ServeArgs {
169
171
struct BuildArgs {
170
172
#[ arg( short, long, help = "Build only content <FILES>" ) ]
171
173
files : Vec < PathBuf > ,
174
+ #[ arg( short, long, help = "Build only content listed in <FILE_LIST>" ) ]
175
+ file_list : Option < PathBuf > ,
172
176
#[ arg( short, long, help = "Abort build on warnings" ) ]
173
177
deny_warnings : bool ,
174
178
#[ arg( long, help = "Disable caching (only for debugging)" ) ]
@@ -283,12 +287,22 @@ fn main() -> Result<(), Error> {
283
287
settings. json_issues = args. json_issues ;
284
288
let _ = SETTINGS . set ( settings) ;
285
289
286
- let arg_files = args
290
+ let mut arg_files = args
287
291
. files
288
292
. iter ( )
289
293
. map ( |path| path. canonicalize ( ) )
290
294
. collect :: < Result < Vec < PathBuf > , _ > > ( ) ?;
291
295
296
+ if let Some ( file_list) = args. file_list {
297
+ arg_files. extend (
298
+ read_to_string ( & file_list) ?
299
+ . lines ( )
300
+ . filter ( |s| !s. is_empty ( ) )
301
+ . map ( |line| Ok ( PathBuf :: from_str ( line) ?. canonicalize ( ) ?) )
302
+ . collect :: < Result < Vec < PathBuf > , Error > > ( ) ?,
303
+ ) ;
304
+ }
305
+
292
306
let templ_stats = if args. templ_stats {
293
307
let ( tx, rx) = channel :: < String > ( ) ;
294
308
TEMPL_RECORDER_SENDER
0 commit comments