예제 #1
0
파일: commands.py 프로젝트: nexiles/gitver
def cmd_build_template(args):
    next_store = KVStore(NEXT_STORE_FILE)
    repo_info = get_repo_info()
    last_tag = repo_info['last-tag']
    has_next_custom = next_store.has(last_tag)
    next_custom = next_store.get(last_tag) if has_next_custom else None
    parse_templates(args.templates, repo_info, next_custom)
예제 #2
0
파일: commands.py 프로젝트: nexiles/gitver
def cmd_clean(args):
    next_store = KVStore(NEXT_STORE_FILE)
    if len(args.tag) > 0:
        tag = args.tag
    else:
        repo_info = get_repo_info()
        tag = repo_info['last-tag']

    has_custom = next_store.has(tag)
    next_custom = next_store.get(tag) if has_custom else None

    if has_custom:
        next_store.rm(tag).save()
        print "Cleaned up custom string version \"" + next_custom + \
              "\" for tag \"" + tag + "\""
    else:
        print "No custom string version found for tag \"" + tag + "\""
예제 #3
0
파일: commands.py 프로젝트: nexiles/gitver
def cmd_info(args):
    next_store = KVStore(NEXT_STORE_FILE)
    repo_info = get_repo_info()
    last_tag = repo_info['last-tag']

    has_next_custom = next_store.has(last_tag)
    next_custom = next_store.get(last_tag) if has_next_custom else None

    if has_next_custom:
        nvn = color_next(next_custom)
    else:
        nvn = "none defined, using " + color_next("-" + cfg['next_suffix']) + \
              " suffix"

    print "Most recent tag: " + color_tag(last_tag)
    print "NEXT defined as: " + nvn
    print "Current build ID: " + color_tag(repo_info['full-build-id'])
    print "Current version: " + \
          color_version("v" + build_version_string(repo_info, next_custom))