config: move logic from CLI to API

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2019-06-06 14:41:02 +03:00
parent f41dcea248
commit 9e9e078de3
16 changed files with 426 additions and 440 deletions
+3 -7
View File
@@ -3,18 +3,14 @@ from __future__ import unicode_literals
import argparse
from dvc.command.base import fix_subparsers, append_doc_link
from dvc.command.remote import CmdRemoteAdd
from dvc.command.config import CmdConfig
from dvc.remote.config import set_cache_dir
class CmdCacheDir(CmdConfig):
def run(self):
self.args.name = "cache.dir"
self.args.value = CmdRemoteAdd.resolve_path(
self.args.value, self.configobj.filename
)
return super(CmdCacheDir, self).run()
set_cache_dir(self.config, self.args.value, level=self.args.level)
return 0
def add_parser(subparsers, parent_parser):