mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-09 23:10:24 +01:00
31 lines
785 B
Python
31 lines
785 B
Python
import argparse
|
|
import logging
|
|
|
|
from dvc.command.base import append_doc_link
|
|
from dvc.command.base import CmdBase
|
|
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
class CmdInstall(CmdBase):
|
|
def run(self):
|
|
try:
|
|
self.repo.install()
|
|
except Exception:
|
|
logger.exception("failed to install DVC Git 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)
|