From 1cbb10abb526b48dccc6c5e70f2a35d300cdcecb Mon Sep 17 00:00:00 2001 From: Eduard Voiculescu Date: Tue, 12 Nov 2024 10:54:52 -0500 Subject: [PATCH] sluggify the package name --- cmd/substreams/registry-publish.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/substreams/registry-publish.go b/cmd/substreams/registry-publish.go index 326993ca..50f56e29 100644 --- a/cmd/substreams/registry-publish.go +++ b/cmd/substreams/registry-publish.go @@ -8,6 +8,7 @@ import ( "mime/multipart" "net/http" "os" + "strings" "github.com/charmbracelet/huh" "github.com/charmbracelet/lipgloss" @@ -176,7 +177,7 @@ func runRegistryPublish(cmd *cobra.Command, args []string) error { fmt.Println("") fmt.Println("Start streaming with:") fmt.Println("") - fmt.Printf(" substreams gui %s@%s\n", packageName, releaseVersion) + fmt.Printf(" substreams gui %s@%s\n", slugifyPackageName(packageName), releaseVersion) fmt.Println("") return nil @@ -214,3 +215,8 @@ func copyPasteTokenForm(endpoint string, linkStyle lipgloss.Style) (string, erro return token, nil } + +func slugifyPackageName(s string) (slug string) { + slug = strings.Replace(s, "_", "-", -1) + return +}