feature/recipe_implementation #5

Merged
gmgauthier merged 54 commits from feature/recipe_implementation into master 2026-03-07 23:17:54 +00:00
Showing only changes of commit 019ce1e95a - Show all commits

View File

@ -47,12 +47,14 @@ func runRecipe(cmd *cobra.Command, args []string) error {
if kv := strings.SplitN(p, "=", 2); len(kv) == 2 { if kv := strings.SplitN(p, "=", 2); len(kv) == 2 {
key := strings.TrimSpace(kv[0]) key := strings.TrimSpace(kv[0])
value := strings.TrimSpace(kv[1]) value := strings.TrimSpace(kv[1])
// simple bool detection
if value == "true" { // Clean bool handling that satisfies staticcheck
switch strings.ToLower(value) {
case "true", "1", "yes", "on":
params[key] = true params[key] = true
} else if value == "false" { case "false", "0", "no", "off":
params[key] = false params[key] = false
} else { default:
params[key] = value params[key] = value
} }
} }
@ -72,7 +74,7 @@ func runRecipe(cmd *cobra.Command, args []string) error {
return runner.Run() return runner.Run()
} }
// resolveRecipePath and findProjectRoot stay exactly as you already have them // resolveRecipePath and findProjectRoot stay exactly as you have them
func resolveRecipePath(nameOrPath string) (string, error) { func resolveRecipePath(nameOrPath string) (string, error) {
if strings.Contains(nameOrPath, "/") || strings.HasSuffix(nameOrPath, ".md") { if strings.Contains(nameOrPath, "/") || strings.HasSuffix(nameOrPath, ".md") {
if _, err := os.Stat(nameOrPath); err == nil { if _, err := os.Stat(nameOrPath); err == nil {
@ -118,16 +120,10 @@ func findProjectRoot() (string, error) {
if _, err := os.Stat(filepath.Join(dir, ".git")); err == nil { if _, err := os.Stat(filepath.Join(dir, ".git")); err == nil {
return dir, nil return dir, nil
} }
if _, err := os.Stat(filepath.Join(dir, ".grokkit")); err == nil {
return dir, nil
}
if _, err := os.Stat(filepath.Join(dir, ".gitignore")); err == nil { if _, err := os.Stat(filepath.Join(dir, ".gitignore")); err == nil {
return dir, nil return dir, nil
} }
if _, err := os.Stat(filepath.Join(dir, "pyproject.toml")); err == nil { if _, err := os.Stat(filepath.Join(dir, ".grokkit")); err == nil {
return dir, nil
}
if _, err := os.Stat(filepath.Join(dir, "CmakeLists.txt")); err == nil {
return dir, nil return dir, nil
} }
if _, err := os.Stat(filepath.Join(dir, "go.mod")); err == nil { if _, err := os.Stat(filepath.Join(dir, "go.mod")); err == nil {