diff options
| -rw-r--r-- | project.py | 4 |
1 files changed, 4 insertions, 0 deletions
| @@ -203,6 +203,10 @@ class _CopyFile: | |||
| 203 | # remove existing file first, since it might be read-only | 203 | # remove existing file first, since it might be read-only |
| 204 | if os.path.exists(dest): | 204 | if os.path.exists(dest): |
| 205 | os.remove(dest) | 205 | os.remove(dest) |
| 206 | else: | ||
| 207 | dir = os.path.dirname(dest) | ||
| 208 | if not os.path.isdir(dir): | ||
| 209 | os.makedirs(dir) | ||
| 206 | shutil.copy(src, dest) | 210 | shutil.copy(src, dest) |
| 207 | # make the file read-only | 211 | # make the file read-only |
| 208 | mode = os.stat(dest)[stat.ST_MODE] | 212 | mode = os.stat(dest)[stat.ST_MODE] |
