From e5ad3f95938883d302f05edf8e5cac17147efc0b Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Fri, 26 Jul 2024 16:50:13 +0300 Subject: [PATCH] Update bridge version linkifying --- cmd/bbctl/whoami.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/bbctl/whoami.go b/cmd/bbctl/whoami.go index 0b11d5a..df4cf6a 100644 --- a/cmd/bbctl/whoami.go +++ b/cmd/bbctl/whoami.go @@ -77,7 +77,7 @@ func coloredBridgeState(state status.BridgeStateEvent) string { } } -var bridgeImageRegex = regexp.MustCompile(`^docker\.beeper-tools\.com/(?:bridge/)?([a-z]+):([0-9a-f]{40})(?:-amd64)?$`) +var bridgeImageRegex = regexp.MustCompile(`^docker\.beeper-tools\.com/(?:bridge/)?([a-z]+):(v2-)?([0-9a-f]{40})(?:-amd64)?$`) var dockerToGitRepo = map[string]string{ "hungryserv": "https://github.com/beeper/hungryserv/commit/%s", @@ -86,10 +86,13 @@ var dockerToGitRepo = map[string]string{ "facebook": "https://github.com/mautrix/facebook/commit/%s", "googlechat": "https://github.com/mautrix/googlechat/commit/%s", "instagram": "https://github.com/mautrix/instagram/commit/%s", + "instagramgo": "https://github.com/mautrix/meta/commit/%s", + "facebookgo": "https://github.com/mautrix/meta/commit/%s", "linkedin": "https://github.com/beeper/linkedin/commit/%s", "signal": "https://github.com/mautrix/signal/commit/%s", "slackgo": "https://github.com/mautrix/slack/commit/%s", "telegram": "https://github.com/mautrix/telegram/commit/%s", + "telegramgo": "https://github.com/mautrix/telegramgo/commit/%s", "twitter": "https://github.com/mautrix/twitter/commit/%s", "whatsapp": "https://github.com/mautrix/whatsapp/commit/%s", } @@ -106,9 +109,9 @@ func parseBridgeImage(bridge, image string, internal bool) string { return color.YellowString(image) } if match[1] == "hungryserv" && !internal { - return match[2][:8] + return match[3][:8] } - return color.HiBlueString(hyper.Link(match[2][:8], fmt.Sprintf(dockerToGitRepo[match[1]], match[2]), false)) + return color.HiBlueString(match[2] + hyper.Link(match[3][:8], fmt.Sprintf(dockerToGitRepo[match[1]], match[3]), false)) } func formatBridgeRemotes(name string, bridge beeperapi.WhoamiBridge) string {