Grab tagged version based on .bumpversion.cfg
This commit is contained in:
		@ -12,9 +12,13 @@ except ImportError:
 | 
			
		||||
    DEVNULL = open(os.devnull, 'wb')
 | 
			
		||||
 | 
			
		||||
def get_tag_version():
 | 
			
		||||
    config = ConfigParser()
 | 
			
		||||
    config.read('./.bumpversion.cfg')
 | 
			
		||||
    tag_expression = config.get('bumpversion','tag_name').replace('{new_version}','[0-9]*.[0-9]*.[0-9]*')
 | 
			
		||||
 | 
			
		||||
    version = "0.0.0"
 | 
			
		||||
    
 | 
			
		||||
    tagged_versions = subprocess.Popen(['git','tag','-l','[0-9]*.[0-9]*.[0-9]*'],
 | 
			
		||||
    tagged_versions = subprocess.Popen(['git','tag','-l',tag_expression],
 | 
			
		||||
        stdout=subprocess.PIPE, stderr=DEVNULL, cwd=".").stdout.read().decode('utf-8').rstrip().split('\n')
 | 
			
		||||
    if len(tagged_versions) > 0 and tagged_versions[-1] != "":
 | 
			
		||||
        version = tagged_versions[-1]
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user