From 109c54f1e55c98c620a9100d6dc83f6460416b01 Mon Sep 17 00:00:00 2001 From: steven carpenter Date: Tue, 22 Jul 2025 03:15:31 -0400 Subject: [PATCH] rebrand app --- cmd/root.go | 6 +++--- cmd/tui.go | 12 ++++-------- go.mod | 3 +-- main.go | 2 +- render/render.go | 1 + 5 files changed, 10 insertions(+), 14 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index e9c52c3..1417c2c 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -4,7 +4,7 @@ import ( "log" "github.com/spf13/cobra" - "specCon18/wand-templater/render" + "specCon18/bubblewand/render" ) // CLI flag variables @@ -18,8 +18,8 @@ var ( // rootCmd renders templates using CLI flags var rootCmd = &cobra.Command{ - Use: "wand-templater", - Short: "A tool to generate a go project template for building a terminal application with bubbletea + cobra + viper + log + mango", + Use: "bubblewand", + Short: "A tool to generate a go project template for building a terminal application with bubbletea + cobra + viper + log", Run: func(cmd *cobra.Command, args []string) { // Fill ProgramData from CLI input data := render.ProgramData{ diff --git a/cmd/tui.go b/cmd/tui.go index 7446ff6..d76d488 100644 --- a/cmd/tui.go +++ b/cmd/tui.go @@ -5,13 +5,13 @@ import ( "github.com/charmbracelet/huh" "github.com/spf13/cobra" - "specCon18/wand-templater/render" + "specCon18/bubblewand/render" ) // tuiCmd renders templates interactively via a form var tuiCmd = &cobra.Command{ Use: "tui", - Short: "an interactive TUI for generating a go module template for terminal applications using bubbletea + cobra + viper + log + mango", + Short: "an interactive TUI for generating a go module template for terminal applications using bubbletea + cobra + viper + log", Run: func(cmd *cobra.Command, args []string) { var data render.ProgramData @@ -22,6 +22,7 @@ var tuiCmd = &cobra.Command{ huh.NewInput().Title("Package Name").Placeholder("e.g. myapp").Value(&data.PackageName), huh.NewInput().Title("Program Version").Placeholder("e.g. 1.0.0").Value(&data.ProgramVersion), huh.NewInput().Title("Program Description").Placeholder("Describe your program").Value(&data.ProgramDesc), + huh.NewInput().Title("Output Directory").Placeholder("Where to output your templated project").Value(&data.OutputDir), ), ) @@ -30,19 +31,14 @@ var tuiCmd = &cobra.Command{ log.Fatalf("form cancelled or failed: %v", err) } - // Retrieve --output flag value - out, _ := cmd.Flags().GetString("output") - // Render templates with user input - if err := render.RenderTemplates(data, out); err != nil { + if err := render.RenderTemplates(data, data.OutputDir); err != nil { log.Fatalf("rendering failed: %v", err) } }, } func init() { - // Allow output dir override - tuiCmd.Flags().StringP("output", "o", "output", "Output directory for rendered files") rootCmd.AddCommand(tuiCmd) } diff --git a/go.mod b/go.mod index 030bbcc..f9478ce 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,4 @@ -module specCon18/wand-templater - +module specCon18/bubblewand go 1.23.11 require ( diff --git a/main.go b/main.go index 0880d8f..530b483 100644 --- a/main.go +++ b/main.go @@ -1,7 +1,7 @@ package main import ( - "specCon18/wand-templater/cmd" + "specCon18/bubblewand/cmd" ) func main() { diff --git a/render/render.go b/render/render.go index 79077a1..d76dd72 100644 --- a/render/render.go +++ b/render/render.go @@ -14,6 +14,7 @@ type ProgramData struct { PackageName string ProgramVersion string ProgramDesc string + OutputDir string } // RenderTemplates renders all .tmpl files from the templates/ directory into outputDir