File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,3 @@ add_custom_target(
1111 ${OUTPUT_DIR}
1212 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
1313 COMMENT "Running main.py" )
14-
15- add_custom_command (
16- TARGET generate_scoreboard
17- POST_BUILD
18- COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR} /static
19- ${OUTPUT_DIR} /static
20- COMMENT "Copying static directory to binary directory" )
Original file line number Diff line number Diff line change 55import argparse
66import subprocess
77import yaml
8+ import shutil
89from jinja2 import Environment , FileSystemLoader
910import logging
1011
@@ -228,10 +229,22 @@ def main():
228229 )
229230 args = parser .parse_args ()
230231
231- output_file = Path (args .output ) / "index.html"
232+ output_path = Path (args .output )
233+ output_path .mkdir (parents = True , exist_ok = True )
234+ output_file = output_path / "index.html"
232235 with open (output_file , "w" ) as file :
233236 file .write (html_content )
234237
238+ static_src = script_dir / "static"
239+ static_dst = output_path / "static"
240+ if static_src .exists ():
241+ if static_dst .exists ():
242+ shutil .rmtree (static_dst )
243+ shutil .copytree (static_src , static_dst )
244+ logger .info ("Static directory copied to %s" , static_dst )
245+ else :
246+ logger .warning ("Static directory not found at %s" , static_src )
247+
235248 logger .info ("HTML page generated at %s" , output_file )
236249
237250
You can’t perform that action at this time.
0 commit comments