- Implement a check to see if the target file already exists
- Prompt the user to confirm if they want to overwrite the existing file
- Exit the script if the user opts not to overwrite
This change improves the user experience by providing a safety measure to prevent accidental file overwriting.