10: sort on stackname (#13)

This commit is contained in:
Arwid Thornström
2022-11-25 12:51:29 +01:00
committed by GitHub
parent 02beda5a40
commit ec092f84d6
@@ -108,6 +108,12 @@ module.exports = {
tto.line('-');
tto.pushrow(['| status', 'stack', 'branch', 'time since update', 'url'])
.line('-');
// Sort on stackname
curratedStacks.sort((a, b) => {
if (a.name < b.name) return -1;
if (a.name > b.name) return 1;
return 0;
});
for (const stack of curratedStacks) {
const t = new Date(stack.updated);
tto.pushrow([status(stack.status), stack.name, ellipsis(stack.branch, 24), timeSince(t.getTime()), stackUrl(stack.name)]);