Tidy up GitHub release tags

This commit is contained in:
Steffen Lange 2020-05-01 15:10:56 +02:00
parent 81ec34b7f9
commit 2694df1973
2 changed files with 5 additions and 2 deletions

View file

@ -42,7 +42,7 @@ abstract class PatchBase {
protected function parse_json(string $key) : bool { protected function parse_json(string $key) : bool {
$flat = iterator_to_array(new \RecursiveIteratorIterator(new \RecursiveArrayIterator($this->data))); $flat = iterator_to_array(new \RecursiveIteratorIterator(new \RecursiveArrayIterator($this->data)));
if (!empty($flat[$key])) { if (!empty($flat[$key])) {
$this->patch->setVersion(ltrim($flat[$key], 'v')); $this->patch->setVersion($flat[$key], true);
return true; return true;
} }
return false; return false;

View file

@ -38,7 +38,10 @@ class PatchObject {
function getVersion() : string { function getVersion() : string {
return $this->version; return $this->version;
} }
function setVersion(string $version) { function setVersion(string $version, bool $trim = false) {
if ($trim) {
$version = preg_replace('/^(release-|v)/', '', $version);
}
$this->version = $version; $this->version = $version;
} }
function getURL() : string { function getURL() : string {