1
0
mirror of synced 2026-08-31 22:46:02 +00:00
Files
spring-security/lib/antora/extensions/version-fix.js
T
Rob Winch 40f6324d8f Instead of deleting aggregate.prerelease set to true
This ensures that the aggregate is not marked as a stable version.
2022-10-18 13:30:55 -05:00

40 lines
1.3 KiB
JavaScript

// https://gitlab.com/antora/antora/-/issues/132#note_712132072
'use strict'
module.exports.register = function({ config }) {
this.on('contentAggregated', ({ contentAggregate }) => {
contentAggregate.forEach(aggregate => {
if (aggregate.name === "" && aggregate.displayVersion === 5.6) {
aggregate.name = "ROOT";
aggregate.version = "5.6.0-RC1"
aggregate.startPage = "ROOT:index.adoc"
aggregate.displayVersion = `${aggregate.version}`
aggregate.prerelease = true
}
else if (aggregate.version === "5.6.1" &&
aggregate.prerelease == "-SNAPSHOT") {
aggregate.version = "5.6.1"
aggregate.displayVersion = `${aggregate.version}`
aggregate.prerelease = true
}
else if (aggregate.prerelease && aggregate.prerelease != true) {
aggregate.version += aggregate.prerelease
aggregate.prerelease = true
}
})
})
}
function out(args) {
console.log(JSON.stringify(args, no_data, 2));
}
function no_data(key, value) {
if (key == "data" || key == "files") {
return value ? "__data__" : value;
}
return value;
}