From 1ba39ca7d73ebcacba97b8db6a2ae33c01954666 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Fri, 7 Jun 2024 06:30:55 -0300 Subject: [PATCH] print bunker restart command without schemes in relay urls when possible. --- bunker.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/bunker.go b/bunker.go index f2f150e..daf1c5e 100644 --- a/bunker.go +++ b/bunker.go @@ -115,10 +115,19 @@ var bunker = &cli.Command{ secretKeyFlag = "--sec " + sec } + relayURLsPossiblyWithoutSchema := make([]string, len(relayURLs)) + for i, url := range relayURLs { + if strings.HasPrefix(url, "wss://") { + relayURLsPossiblyWithoutSchema[i] = url[6:] + } else { + relayURLsPossiblyWithoutSchema[i] = url + } + } + restartCommand := fmt.Sprintf("nak bunker %s%s %s", secretKeyFlag, preauthorizedFlags, - strings.Join(relayURLs, " "), + strings.Join(relayURLsPossiblyWithoutSchema, " "), ) log("listening at %v:\n pubkey: %s \n npub: %s%s%s\n to restart: %s\n bunker: %s\n\n",