Mercurial > public > develkit
comparison init50-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 | 54614542f0f7 |
comparison
equal
deleted
inserted
replaced
333:10e2b8595ace | 334:64a8d53c6d98 |
---|---|
808 } | 808 } |
809 .sort { v1, v2 -> v2 <=> v1 } | 809 .sort { v1, v2 -> v2 <=> v1 } |
810 | 810 |
811 def branches = "git branch --remote".execute().text.split("\n") | 811 def branches = "git branch --remote".execute().text.split("\n") |
812 .findAll { it.contains('release') || it.contains('hotfix') } | 812 .findAll { it.contains('release') || it.contains('hotfix') } |
813 .collect { it.replaceAll('\\s+', ' ').split(' ')[1].split('/')[2] - 'v' } | 813 .collect { it.replaceAll('\\s+', ' ').split('/').last() - 'v' } |
814 .collect { new Version(*it.split('\\.')*.toInteger()) } | 814 .collect { new Version(*it.split('\\.')*.toInteger()) } |
815 | 815 |
816 def results = (branches + versions).sort { v1, v2 -> v2 <=> v1 } | 816 def results = (branches + versions).sort { v1, v2 -> v2 <=> v1 } |
817 if (results.isEmpty()) { | 817 if (results.isEmpty()) { |
818 return new Version().nextSnapshot() | 818 return new Version().nextSnapshot() |