unittestleri seviyoruz. iki tane daha bug temizledik..
sevgili paket geliştiricisi arkadaşlar, lütfen shelltools.copy kullandığınızda paketlerin içeriğinin doğru olup olmadığını test etmeyi ihmal etmeyiniz. python'un standart library'si içerisindeki copy gerçekten çok kötü. actionsapi içerisinde mükemmele yaklaşıyoruz, fakat test etmemiz gerekli.
This commit is contained in:
@@ -138,7 +138,10 @@ def copy(source, destination, sym = True):
|
|||||||
os.remove(destination)
|
os.remove(destination)
|
||||||
os.symlink(os.readlink(filePath), destination)
|
os.symlink(os.readlink(filePath), destination)
|
||||||
elif isLink(filePath) and not sym:
|
elif isLink(filePath) and not sym:
|
||||||
shutil.copy(os.readlink(filePath), destination)
|
if isDirectory(os.readlink(filePath)):
|
||||||
|
copytree(os.readlink(filePath), destination)
|
||||||
|
else:
|
||||||
|
shutil.copy(os.readlink(filePath), destination)
|
||||||
elif isDirectory(filePath):
|
elif isDirectory(filePath):
|
||||||
copytree(filePath, destination, sym)
|
copytree(filePath, destination, sym)
|
||||||
else:
|
else:
|
||||||
@@ -148,8 +151,12 @@ def copytree(source, destination, sym = True):
|
|||||||
'''recursively copy an entire directory tree rooted at source'''
|
'''recursively copy an entire directory tree rooted at source'''
|
||||||
if isDirectory(source):
|
if isDirectory(source):
|
||||||
if os.path.exists(destination):
|
if os.path.exists(destination):
|
||||||
copytree(source, join_path(destination, os.path.basename(source)))
|
if isDirectory(destination):
|
||||||
return
|
copytree(source, join_path(destination, os.path.basename(source.strip('/'))))
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
copytree(source, join_path(destination, os.path.basename(source)))
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
shutil.copytree(source, destination, sym)
|
shutil.copytree(source, destination, sym)
|
||||||
except OSError, e:
|
except OSError, e:
|
||||||
|
|||||||
Reference in New Issue
Block a user