From ec092f84d665a76fc8a7934862392f2969ef8178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arwid=20Thornstr=C3=B6m?= Date: Fri, 25 Nov 2022 12:51:29 +0100 Subject: [PATCH] 10: sort on stackname (#13) --- src/commands/deployment/testservers/status/status.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/commands/deployment/testservers/status/status.ts b/src/commands/deployment/testservers/status/status.ts index 2c4a605..fa18f88 100644 --- a/src/commands/deployment/testservers/status/status.ts +++ b/src/commands/deployment/testservers/status/status.ts @@ -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)]);