Skip to content

Commit

Permalink
sluggify the package name
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduard-Voiculescu committed Nov 12, 2024
1 parent 883e29f commit 1cbb10a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/substreams/registry-publish.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"mime/multipart"
"net/http"
"os"
"strings"

"github.com/charmbracelet/huh"
"github.com/charmbracelet/lipgloss"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}

0 comments on commit 1cbb10a

Please sign in to comment.