comparison init20-git.gradle @ 334:64a8d53c6d98

change how the version is parsed from git commands
author Marc Davis <davis@ssdt-ohio.org>
date Mon, 06 Mar 2023 15:36:07 -0500
parents 7bc7c6c79d7c
children de8c350c511a
comparison
equal deleted inserted replaced
333:10e2b8595ace 334:64a8d53c6d98
843 } 843 }
844 .sort { v1, v2 -> v2 <=> v1 } 844 .sort { v1, v2 -> v2 <=> v1 }
845 845
846 def branches = "git branch --remote".execute().text.split("\n") 846 def branches = "git branch --remote".execute().text.split("\n")
847 .findAll { it.contains('release') || it.contains('hotfix') } 847 .findAll { it.contains('release') || it.contains('hotfix') }
848 .collect { it.replaceAll('\\s+', ' ').split(' ')[1].split('/')[2] - 'v' } 848 .collect { it.replaceAll('\\s+', ' ').split('/').last() - 'v' }
849 .collect { new Version(*it.split('\\.')*.toInteger()) } 849 .collect { new Version(*it.split('\\.')*.toInteger()) }
850 850
851 def results = (branches + versions).sort { v1, v2 -> v2 <=> v1 } 851 def results = (branches + versions).sort { v1, v2 -> v2 <=> v1 }
852 if (results.isEmpty()) { 852 if (results.isEmpty()) {
853 return new Version().nextSnapshot() 853 return new Version().nextSnapshot()