mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Fix utils.copy for copying files, add unit tests
`copy('', 'a/b.ext0', 'c/d.ext1')` is copying `a/b.ext0` into `c/d.ext1/b.ext0`
(creating folder `c/d.ext1` in the process) instead of `c/d.ext1`.
Bug introduced by e03cf3f517.
This commit is contained in:
parent
e10fe42928
commit
7da0506f2d
2 changed files with 94 additions and 1 deletions
|
|
@ -273,7 +273,7 @@ def copy(path, source, destination, destination_path=None):
|
|||
destination_ = os.path.abspath(
|
||||
os.path.expanduser(os.path.join(destination, destination_path)))
|
||||
|
||||
if not os.path.exists(destination_):
|
||||
if not os.path.exists(destination_) and not os.path.isfile(source_):
|
||||
os.makedirs(destination_)
|
||||
|
||||
def recurse(source, destination):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue