mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-11 15:28:27 +01:00
- Uses a formatter for coloring output - Move the `progress_aware` decorator logic to the logger itself - Refactor modules so each one uses their own instance of a logger Close #1753
32 lines
798 B
Python
32 lines
798 B
Python
from __future__ import unicode_literals
|
|
|
|
import argparse
|
|
import logging
|
|
|
|
from dvc.command.base import CmdBase, append_doc_link
|
|
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
class CmdInstall(CmdBase):
|
|
def run_cmd(self):
|
|
try:
|
|
self.repo.install()
|
|
except Exception:
|
|
logger.exception("failed to install dvc hooks")
|
|
return 1
|
|
return 0
|
|
|
|
|
|
def add_parser(subparsers, parent_parser):
|
|
INSTALL_HELP = "Install DVC git hooks into the repository."
|
|
install_parser = subparsers.add_parser(
|
|
"install",
|
|
parents=[parent_parser],
|
|
description=append_doc_link(INSTALL_HELP, "install"),
|
|
help=INSTALL_HELP,
|
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
)
|
|
install_parser.set_defaults(func=CmdInstall)
|