comparison init40-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 10e2b8595ace
children 6ffbb6233f85
comparison
equal deleted inserted replaced
333:10e2b8595ace 334:64a8d53c6d98
810 .findAll { it != null } 810 .findAll { it != null }
811 .sort { v1, v2 -> v2 <=> v1 } 811 .sort { v1, v2 -> v2 <=> v1 }
812 812
813 def branches = "git branch --all".execute().text.split("\n") 813 def branches = "git branch --all".execute().text.split("\n")
814 .findAll { it.contains('release') || it.contains('hotfix') } 814 .findAll { it.contains('release') || it.contains('hotfix') }
815 .collect { it.replaceAll('\\s+', ' ').split(' ')[1].split('/')[2] - 'v' } 815 .collect { it.replaceAll('\\s+', ' ').split('/').last() - 'v' }
816 .collect { new Version(*it.split('\\.')*.toInteger()) } 816 .collect { new Version(*it.split('\\.')*.toInteger()) }
817 817
818 def results = (branches + versions).sort { v1, v2 -> v2 <=> v1 } 818 def results = (branches + versions).sort { v1, v2 -> v2 <=> v1 }
819 results.each { println it } 819 results.each { println it }
820 if (results.isEmpty()) { 820 if (results.isEmpty()) {