Skip to content

Commit b2f40dc

Browse files
authored
Update copyndk.py
1 parent cb6968f commit b2f40dc

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

copyndk.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff 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+
3449
if __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-

0 commit comments

Comments
 (0)