@@ -270,6 +270,12 @@ fn main() -> Result<(), Error> {
270
270
settings. json_issues = args. json_issues ;
271
271
let _ = SETTINGS . set ( settings) ;
272
272
273
+ let arg_files = args
274
+ . files
275
+ . iter ( )
276
+ . map ( |path| path. canonicalize ( ) )
277
+ . collect :: < Result < Vec < PathBuf > , _ > > ( ) ?;
278
+
273
279
let templ_stats = if args. templ_stats {
274
280
let ( tx, rx) = channel :: < String > ( ) ;
275
281
TEMPL_RECORDER_SENDER
@@ -303,7 +309,7 @@ fn main() -> Result<(), Error> {
303
309
None
304
310
} ;
305
311
306
- let cache = match ( args . files . is_empty ( ) , args. no_cache ) {
312
+ let cache = match ( arg_files . is_empty ( ) , args. no_cache ) {
307
313
( _, true ) => Cache :: None ,
308
314
( true , false ) => Cache :: Static ,
309
315
( false , false ) => Cache :: Dynamic ,
@@ -315,10 +321,10 @@ fn main() -> Result<(), Error> {
315
321
let mut urls = Vec :: new ( ) ;
316
322
let mut docs = Vec :: new ( ) ;
317
323
info ! ( "Building everything 🛠️" ) ;
318
- if args. all || !args. no_basic || args. content || !args . files . is_empty ( ) {
324
+ if args. all || !args. no_basic || args. content || !arg_files . is_empty ( ) {
319
325
let start = std:: time:: Instant :: now ( ) ;
320
- docs = if !args . files . is_empty ( ) {
321
- read_docs_parallel :: < Page , Doc > ( & args . files , None ) ?
326
+ docs = if !arg_files . is_empty ( ) {
327
+ read_docs_parallel :: < Page , Doc > ( & arg_files , None ) ?
322
328
} else if args. no_cache {
323
329
let files: & [ _ ] = if let Some ( translated_root) = content_translated_root ( ) {
324
330
& [ content_root ( ) , translated_root]
@@ -342,7 +348,7 @@ fn main() -> Result<(), Error> {
342
348
urls. extend ( spas) ;
343
349
info ! ( "Took: {: >10.3?} to build spas ({num})" , start. elapsed( ) , ) ;
344
350
}
345
- if args. all || !args. no_basic || args. content || !args . files . is_empty ( ) {
351
+ if args. all || !args. no_basic || args. content || !arg_files . is_empty ( ) {
346
352
let start = std:: time:: Instant :: now ( ) ;
347
353
let ( docs, meta) = build_docs ( & docs) ?;
348
354
build_top_level_meta ( meta) ?;
0 commit comments