#!python

import os
from civis_jupyter_notebooks.git_utils import CivisGit, CivisGitError
from civis_jupyter_notebooks import log_utils

stream_logger = log_utils.setup_stream_logging()

if os.environ.get('GIT_REPO_URL'):
    try:
        stream_logger.info('cloning git repository')
        CivisGit().clone_repository()
        stream_logger.info('clone complete')
    except CivisGitError as e:
        stream_logger.error('error clonging git repository: {}'.format(str(e)))
