diff --git a/cmd/rehash.go b/cmd/rehash.go index 4843496..3128ecf 100644 --- a/cmd/rehash.go +++ b/cmd/rehash.go @@ -6,6 +6,7 @@ import ( "github.com/packwiz/packwiz/core" "github.com/spf13/cobra" + "golang.org/x/exp/slices" ) // rehashCmd represents the rehash command @@ -36,6 +37,11 @@ var rehashCmd = &cobra.Command{ os.Exit(1) } + if !slices.Contains([]string{"sha1", "sha512", "sha256"}, args[0]) { + fmt.Printf("Hash format '%s' is not supported\n", args[0]) + os.Exit(1) + } + session, err := core.CreateDownloadSession(mods, []string{args[0]}) if err != nil { fmt.Printf("Error retrieving external files: %v\n", err)