mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-09 23:10:24 +01:00
dvc: properly save symlinks
Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
+1
-1
@@ -61,7 +61,7 @@ class System(object):
|
||||
@staticmethod
|
||||
def inode(path):
|
||||
if System.is_unix():
|
||||
return os.stat(path).st_ino
|
||||
return os.lstat(path).st_ino
|
||||
|
||||
# getdirinfo from ntfsutils works on both files and dirs
|
||||
info = System.getdirinfo(path)
|
||||
|
||||
@@ -99,6 +99,11 @@ def move(src, dst):
|
||||
if not os.path.exists(dname):
|
||||
os.makedirs(dname)
|
||||
|
||||
if os.path.islink(src):
|
||||
shutil.copy(os.readlink(src), dst)
|
||||
os.unlink(src)
|
||||
return
|
||||
|
||||
shutil.move(src, dst)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user