(source, destination)
| 430 | |
| 431 | |
| 432 | def copy_local_files(source, destination): |
| 433 | if os.path.isdir(source): |
| 434 | for file_name in os.listdir(source): |
| 435 | full_source_path = os.path.join(source, file_name) |
| 436 | if os.path.isfile(full_source_path): |
| 437 | file_extension = file_name.split('.')[-1] if '.' in file_name else 'unknown' |
| 438 | file_type_dir = os.path.join(destination, file_extension) |
| 439 | os.makedirs(file_type_dir, exist_ok=True) |
| 440 | full_destination_path = os.path.join(file_type_dir, file_name) |
| 441 | shutil.copy(full_source_path, full_destination_path) |
| 442 | # print(f"Copied: {full_source_path} -> {full_destination_path}") |
| 443 | elif os.path.isfile(source): |
| 444 | file_name = os.path.basename(source) |
| 445 | file_extension = file_name.split('.')[-1] if '.' in file_name else 'unknown' |
| 446 | file_type_dir = os.path.join(destination, file_extension) |
| 447 | os.makedirs(file_type_dir, exist_ok=True) |
| 448 | full_destination_path = os.path.join(file_type_dir, file_name) |
| 449 | shutil.copy(source, full_destination_path) |
| 450 | # print(f"Copied: {source} -> {full_destination_path}") |
| 451 | else: |
| 452 | prRed(f"Invalid local path: {source}") |
| 453 | |
| 454 | |
| 455 | def is_web_server(ip): |
no test coverage detected