Prefix/suffix not taken into account (#62)

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2021-04-07 20:31:35 +02:00
committed by GitHub
parent f39f06a624
commit 84b9e75d44
3 changed files with 126 additions and 35 deletions

View File

@ -99,11 +99,14 @@ export class Meta {
}
const currentDate = this.date;
const vraw = handlebars.compile(tag.attrs['pattern'])({
date: function (format) {
return moment(currentDate).utc().format(format);
}
});
const vraw = this.setFlavor(
handlebars.compile(tag.attrs['pattern'])({
date: function (format) {
return moment(currentDate).utc().format(format);
}
}),
tag
);
if (version.main == undefined) {
version.main = vraw;
@ -138,21 +141,16 @@ export class Meta {
includePrerelease: true
});
if (semver.prerelease(vraw)) {
vraw = handlebars.compile('{{version}}')(sver);
if (version.main == undefined) {
version.main = vraw;
} else if (vraw !== version.main) {
version.partial.push(vraw);
}
vraw = this.setFlavor(handlebars.compile('{{version}}')(sver), tag);
} else {
vraw = handlebars.compile(tag.attrs['pattern'])(sver);
if (version.main == undefined) {
version.main = vraw;
} else if (vraw !== version.main) {
version.partial.push(vraw);
}
vraw = this.setFlavor(handlebars.compile(tag.attrs['pattern'])(sver), tag);
latest = true;
}
if (version.main == undefined) {
version.main = vraw;
} else if (vraw !== version.main) {
version.partial.push(vraw);
}
if (version.latest == undefined) {
version.latest = this.flavor.latest == 'auto' ? latest : this.flavor.latest == 'true';
}
@ -189,7 +187,7 @@ export class Meta {
return version;
}
vraw = tmatch[tag.attrs['group']];
vraw = this.setFlavor(tmatch[tag.attrs['group']], tag);
latest = true;
if (version.main == undefined) {