File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -31,12 +31,27 @@ def copy_files_and_dirs(source_dir, target_dir):
3131 shutil .copy2 (source_path , target_path )
3232 print (f"Copied file { source_path } to { target_path } " )
3333
34+ def copy_file (source_file_path , target_file_path ):
35+ """
36+ Copy a single file from source to target. Overwrites the target file if it exists.
37+
38+ Args:
39+ - source_file_path: The absolute path to the source file.
40+ - target_file_path: The absolute path to the target file.
41+ """
42+ # Ensure the target directory exists.
43+ os .makedirs (os .path .dirname (target_file_path ), exist_ok = True )
44+
45+ # Copy the file, overwriting any existing file with the same name at the target.
46+ shutil .copy2 (source_file_path , target_file_path )
47+ print (f"Copied file { source_file_path } to { target_file_path } " )
48+
3449if __name__ == "__main__" :
3550 if len (sys .argv ) != 3 :
3651 print ("Usage: python copy_files.py <source_directory> <target_directory>" )
3752 else :
3853 source_directory = sys .argv [1 ]
3954 target_directory = sys .argv [2 ]
4055 copy_files_and_dirs (source_directory + "/bin" , target_directory + "/bin" )
56+ copy_file (source_directory + "/bin/lld.exe" , target_directory + "/bin/ld.exe" )
4157 copy_files_and_dirs (source_directory + "/lib/clang" , target_directory + "/lib/clang" )
42-
You can’t perform that action at this time.
0 commit comments