mirror of
https://github.com/packwiz/packwiz.git
synced 2025-10-14 06:54:32 +02:00
Convert to Title Case
I am aware that this is a somewhat pointless dependency I don't really care though, it's not *that* big!!
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
"github.com/fatih/camelcase"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/igorsobreira/titlecase"
|
||||
)
|
||||
|
||||
// initCmd represents the init command
|
||||
@@ -45,7 +46,7 @@ var initCmd = &cobra.Command{
|
||||
}
|
||||
if directoryName != "." && len(directoryName) > 0 {
|
||||
// Turn directory name into a space-seperated proper name
|
||||
name = strings.ReplaceAll(strings.ReplaceAll(strings.Join(camelcase.Split(directoryName), " "), " - ", " "), " _ ", " ")
|
||||
name = titlecase.Title(strings.ReplaceAll(strings.ReplaceAll(strings.Join(camelcase.Split(directoryName), " "), " - ", " "), " _ ", " "))
|
||||
fmt.Print("Modpack name [" + name + "]: ")
|
||||
} else {
|
||||
fmt.Print("Modpack name: ")
|
||||
|
Reference in New Issue
Block a user