get: copy regular files

Allows `dvc get` to copy regular files or directories.

fixes: #2515
This commit is contained in:
Dani Hodovic
2019-12-05 21:05:00 +01:00
parent 4917a6e818
commit af2f216c5e
4 changed files with 61 additions and 27 deletions
+3 -1
View File
@@ -41,7 +41,8 @@ class TestDirFixture(object):
# in tests, we replace foo with bar, so we need to make sure that when we
# modify a file in our tests, its content length changes.
BAR_CONTENTS = BAR + "r"
CODE = "code.py"
CODE_DIR = "code"
CODE = "code/code.py"
CODE_CONTENTS = (
"import sys\nimport shutil\n"
"shutil.copyfile(sys.argv[1], sys.argv[2])"
@@ -90,6 +91,7 @@ class TestDirFixture(object):
self._pushd(self._root_dir)
self.create(self.FOO, self.FOO_CONTENTS)
self.create(self.BAR, self.BAR_CONTENTS)
os.mkdir(self.CODE_DIR)
self.create(self.CODE, self.CODE_CONTENTS)
os.mkdir(self.DATA_DIR)
os.mkdir(self.DATA_SUB_DIR)