diff options
-rw-r--r-- | project.py | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -2373,6 +2373,14 @@ class Project(object): | |||
2373 | if name in symlink_dirs and not os.path.lexists(src): | 2373 | if name in symlink_dirs and not os.path.lexists(src): |
2374 | os.makedirs(src) | 2374 | os.makedirs(src) |
2375 | 2375 | ||
2376 | if name in to_symlink: | ||
2377 | os.symlink(os.path.relpath(src, os.path.dirname(dst)), dst) | ||
2378 | elif copy_all and not os.path.islink(dst): | ||
2379 | if os.path.isdir(src): | ||
2380 | shutil.copytree(src, dst) | ||
2381 | elif os.path.isfile(src): | ||
2382 | shutil.copy(src, dst) | ||
2383 | |||
2376 | # If the source file doesn't exist, ensure the destination | 2384 | # If the source file doesn't exist, ensure the destination |
2377 | # file doesn't either. | 2385 | # file doesn't either. |
2378 | if name in symlink_files and not os.path.lexists(src): | 2386 | if name in symlink_files and not os.path.lexists(src): |
@@ -2381,13 +2389,6 @@ class Project(object): | |||
2381 | except OSError: | 2389 | except OSError: |
2382 | pass | 2390 | pass |
2383 | 2391 | ||
2384 | if name in to_symlink: | ||
2385 | os.symlink(os.path.relpath(src, os.path.dirname(dst)), dst) | ||
2386 | elif copy_all and not os.path.islink(dst): | ||
2387 | if os.path.isdir(src): | ||
2388 | shutil.copytree(src, dst) | ||
2389 | elif os.path.isfile(src): | ||
2390 | shutil.copy(src, dst) | ||
2391 | except OSError as e: | 2392 | except OSError as e: |
2392 | if e.errno == errno.EPERM: | 2393 | if e.errno == errno.EPERM: |
2393 | raise DownloadError('filesystem must support symlinks') | 2394 | raise DownloadError('filesystem must support symlinks') |