tag.py 文件源码

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

项目:acsoo 作者: acsone 项目源码 文件源码
def do_tag(config, force, src, requirement, yes):
    tag = config.version
    if not yes:
        click.confirm('Tag project with {}?'.format(tag), abort=True)
    if force:
        force_cmd = ['-f']
    else:
        force_cmd = []
    if call(['git', 'diff', '--exit-code']) != 0:
        raise click.ClickException("Please commit first.")
    if call(['git', 'diff', '--exit-code', '--cached']) != 0:
        raise click.ClickException("Please commit first.")
    out = check_output(['git', 'ls-files', '--other', '--exclude-standard',
                        '--directory'])
    if out:
        click.echo(out)
        raise click.ClickException("Please commit first.")
    do_tag_requirements(config, force, src, requirement, yes=True)
    check_call(['git', 'tag'] + force_cmd + [tag])
    check_call(['git', 'push', '-q'] + force_cmd + ['origin', 'tag', tag])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号