def run_command(command, display_cmd=False, ignore_error=False, print_to_console=True):
    'Run bash command and print output to stdout\n    '
    if (display_cmd == True):
        click.echo((click.style('Running command: ', fg='cyan') + click.style(command, fg='green')))
    proc = subprocess.Popen(command, shell=True, text=True, stdout=subprocess.PIPE)
    (out, err) = proc.communicate()
    if ((len(out) > 0) and print_to_console):
        click.echo(out)
    if ((proc.returncode != 0) and (not ignore_error)):
        sys.exit(proc.returncode)
    return (out, err)
Run bash command and print output to stdout
def run_command(command, display_cmd=False, ignore_error=False, print_to_console=True):
    '\n    '
    if (display_cmd == True):
        click.echo((click.style('Running command: ', fg='cyan') + click.style(command, fg='green')))
    proc = subprocess.Popen(command, shell=True, text=True, stdout=subprocess.PIPE)
    (out, err) = proc.communicate()
    if ((len(out) > 0) and print_to_console):
        click.echo(out)
    if ((proc.returncode != 0) and (not ignore_error)):
        sys.exit(proc.returncode)
    return (out, err)