@@ -240,6 +240,13 @@ def _meta(content: str) -> str:
240240 return html .escape (content , quote = True )
241241
242242
243+ def _display_path (path : Path , root : Path ) -> str :
244+ try :
245+ return path .relative_to (root ).as_posix ()
246+ except ValueError :
247+ return path .as_posix ()
248+
249+
243250def _share_page_url (site_url : str , stop_id : str ) -> str :
244251 return f"{ _normalize_site_url (site_url )} /atlas/share/{ quote (stop_id , safe = '-._~' )} /"
245252
@@ -397,17 +404,17 @@ def main() -> int:
397404
398405 if args .check :
399406 if added_count :
400- print (f"{ added_count } downloaded sound file(s) are missing from { route_path . relative_to ( root )} ." )
407+ print (f"{ added_count } downloaded sound file(s) are missing from { _display_path ( route_path , root )} ." )
401408 return 1
402- print (f"All { len (media )} downloaded sound file(s) are represented in { route_path . relative_to ( root )} ." )
409+ print (f"All { len (media )} downloaded sound file(s) are represented in { _display_path ( route_path , root )} ." )
403410 return 0
404411
405412 site_url = args .site_url or _site_url_from_cname (root )
406413 write_route (output_path , merged )
407414 write_share_pages (root , merged , site_url )
408415 write_discovery_files (root , merged , site_url )
409416 print (
410- f"Wrote { len (merged )} atlas stop(s) to { output_path . relative_to ( root )} ; "
417+ f"Wrote { len (merged )} atlas stop(s) to { _display_path ( output_path , root )} ; "
411418 f"{ added_count } stop(s) added; generated { len (merged )} share page(s)." ,
412419 )
413420 return 0
0 commit comments