sandbox/git.py
def clone(alias: str, url: str) -> int:
    """Execute a 'git clone <url> <alias>' inside EXTERNAL_LIBRARIES_ROOT, returning the command's
    status code."""
    cwd = os.getcwd()
    try:
        os.chdir(settings.EXTERNAL_LIBRARIES_ROOT)
        cmd = f"GIT_TERMINAL_PROMPT=0 git clone {url} {alias}"
        p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
        out, err = p.communicate()
        if p.returncode:
            logger.error(f"Could not clone the external lib '{url}' into '{alias}'\n"
                         f"stdout: {out.decode()}\nstderr: {err.decode()}")
        return p.returncode
    finally:
        os.chdir(cwd)
Execute a 'git clone <url> <alias>' inside EXTERNAL_LIBRARIES_ROOT, returning the command's
    status code.
Execute a 'git clone  ' inside EXTERNAL_LIBRARIES_ROOT, returning the command's
status code.
Execute a ' git clone ' inside EXTERNAL_LIBRARIES_ROOT returning the command ' s status code .
def clone(alias: str, url: str) -> int:
    cwd = os.getcwd()
    try:
        os.chdir(settings.EXTERNAL_LIBRARIES_ROOT)
        cmd = f"GIT_TERMINAL_PROMPT=0 git clone {url} {alias}"
        p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
        out, err = p.communicate()
        if p.returncode:
            logger.error(f"Could not clone the external lib '{url}' into '{alias}'\n"
                         f"stdout: {out.decode()}\nstderr: {err.decode()}")
        return p.returncode
    finally:
        os.chdir(cwd)
def clone ( alias : str , url : str ) -> int : cwd = os . getcwd ( ) try : os . chdir ( settings . EXTERNAL_LIBRARIES_ROOT ) cmd = f"GIT_TERMINAL_PROMPT=0 git clone {url} {alias}" p = subprocess . Popen ( cmd , stdout = subprocess . PIPE , stderr = subprocess . PIPE , shell = True ) out , err = p . communicate ( ) if p . returncode : logger . error ( f"Could not clone the external lib '{url}' into '{alias}'\n" f"stdout: {out.decode()}\nstderr: {err.decode()}" ) return p . returncode finally : os . chdir ( cwd )
Execute a 'git clone <url> <alias>' inside EXTERNAL_LIBRARIES_ROOT, returning the command's
status code.
Execute a ' git clone <url > <alias > ' inside EXTERNAL_LIBRARIES_ROOT returning the command ' s status code .
"""Execute a 'git clone <url> <alias>' inside EXTERNAL_LIBRARIES_ROOT, returning the command's
    status code."""
alias
str
url
str