# Path: mkdocs/exceptions.py
# class Abort(MkDocsException):
#     """Abort the build"""
#     def show(self, **kwargs):
#         echo(self.format_message())


import logging
import subprocess
import os
import re
import mkdocs
import ghp_import
from packaging import version
from mkdocs.exceptions import Abort


log = logging.getLogger(__name__)

default_message = """Deployed {sha} with MkDocs version: {version}"""


def _is_cwd_git_repo():
    try:
        proc = subprocess.Popen(
            ['git', 'rev-parse', '--is-inside-work-tree'],
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE
        )
    except FileNotFoundError:
        log.error("Could not find git - is it installed and on your path?")

# Path: mkdocs/exceptions.py
# class Abort(MkDocsException):
#     """Abort the build"""
#     def show(self, **kwargs):
#         echo(self.format_message())


# Path: mkdocs/commands/gh_deploy.py
import logging
import subprocess
import os
import re
import mkdocs
import ghp_import
from packaging import version
from mkdocs.exceptions import Abort



log = logging.getLogger(__name__)

default_message = """Deployed {sha} with MkDocs version: {version}"""


def _is_cwd_git_repo():
    try:
        proc = subprocess.Popen(
            ['git', 'rev-parse', '--is-inside-work-tree'],
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE
        )
    except FileNotFoundError:
        log.error("Could not find git - is it installed and on your path?")

        raise Abort('Deployment Aborted!')