gpg.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:scriptworker 作者: mozilla-releng 项目源码 文件源码
def get_latest_tag(path,
                         exec_function=asyncio.create_subprocess_exec):
    """Get the latest tag in path.

    Args:
        path (str): the path to run ``git describe --abbrev=0`` in.

    Returns:
        str: the tag name found.

    Raises:
        ScriptWorkerRetryException: on failure.

    """
    proc = await exec_function(
        'git', "describe", "--abbrev=0", cwd=path,
        stdout=PIPE, stderr=DEVNULL, stdin=DEVNULL, close_fds=True,
    )
    tag, err = await proc.communicate()
    exitcode = await proc.wait()
    if exitcode:
        raise ScriptWorkerRetryException(
            "Can't get tag at {}: {}!".format(path, err)
        )
    return tag.decode('utf-8').rstrip()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号