fuzzyworld

template / commit

include indices in `template list`, and no longer init on install

7add4991e4e27872eb85c67c1f69244ec3657393 · Pavel Safronov · 2026-01-30 22:50:13 -0800 · parents 05c30431c8b2

include indices in `template list`, and no longer init on install
 Makefile |  1 -
 main.go  | 12 ++++++++----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index f5525ce..2f5792e 100644
--- a/Makefile
+++ b/Makefile
@@ -39,7 +39,6 @@ test_coverage_html: test_coverage
 
 install: build test lint
 	go install ${LDFLAGS}
-	template init

 
 uninstall:
 	go clean -i gitlab.com/PavelSafronov/template...
diff --git a/main.go b/main.go
index 57b87ca..a7cc0b0 100644
--- a/main.go
+++ b/main.go
@@ -137,8 +137,8 @@ func main() {
 					config := settings.config
 					// list profiles
 					fmt.Println("Available profiles:")
-					for _, p := range config.Profiles {
-						fmt.Printf("  %v: \n", p.Name)
+					for i, p := range config.Profiles {
+						fmt.Printf(" %d: %v\n", i+1, p.Name)
 						fmt.Printf("      %v\n", p.Description)
 					}
 					fmt.Println()
@@ -413,7 +413,9 @@ func createSettings(
 		if settings.profile == "" && args.Len() > currentParamIndex {
 			settings.profile = args.Get(currentParamIndex)
 		}
-		fmt.Println("Profile:", settings.profile)
+		if settings.profile != "" {
+			fmt.Println("Profile:", settings.profile)
+		}
 		currentParamIndex++
 	}
 
@@ -423,7 +425,9 @@ func createSettings(
 		settings.projectName = args.Get(currentParamIndex)
 		// currentParamIndex++
 	}
-	fmt.Println("Project name:", settings.projectName)
+	if settings.projectName != "" {
+		fmt.Println("Project name:", settings.projectName)
+	}
 
 	// extras strings
 	_, err = os.Stat(settings.extrasFilePath)