dvc: introduce dvc cache dir command

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2019-01-04 09:02:37 +02:00
parent d1be895b61
commit db6cd8e1bb
3 changed files with 79 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import os
from dvc.command.config import CmdConfig
class CmdCacheDir(CmdConfig):
def run(self):
self.args.name = 'cache.dir'
path = self.args.value
if not os.path.isabs(path):
config_dir = os.path.dirname(self.configobj.filename)
path = os.path.relpath(path, config_dir)
self.args.value = path
return super(CmdCacheDir, self).run()