klen/Flask-Collect — pull request #11 by paltman (2014-12-21 17:13:41+00:00)
Title: Remove file if it already exists before copying

The shutil.copy command will not overwrite files that are read-only which could (should) be the case when deploying files to a webserver, by removing the file if it already exists it will allow the file to be properly replaced with the subsequent copy command.

This is how Django's collectstatic command works (see: https://github.com/django/django/blob/master/django/contrib/staticfiles/management/commands/collectstatic.py#L306) which it appears this app is roughly modeled after.