add error logging to LoadMetadata, fix deploy sed command
- Log YAML parse errors in LoadMetadata instead of silently swallowing - Add debug log for successful metadata loads (tagline, useCases, optConfig counts) - Fix CLAUDE.md deploy command: use sudo, target only image: line in sed Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package stacks
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -92,13 +93,16 @@ func LoadMetadata(stackDir string) Metadata {
|
||||
}
|
||||
|
||||
if err := yaml.Unmarshal(data, &meta); err != nil {
|
||||
// Parse error — still return defaults
|
||||
fmt.Fprintf(os.Stderr, "[ERROR] Failed to parse .felhom.yml in %s: %v\n", stackDir, err)
|
||||
dirName := filepath.Base(stackDir)
|
||||
meta.DisplayName = toTitleCase(strings.ReplaceAll(dirName, "-", " "))
|
||||
meta.Slug = dirName
|
||||
return meta
|
||||
}
|
||||
|
||||
fmt.Fprintf(os.Stderr, "[DEBUG] Loaded metadata for %s: tagline=%q, useCases=%d, optConfig=%d\n",
|
||||
filepath.Base(stackDir), meta.AppInfo.Tagline, len(meta.AppInfo.UseCases), len(meta.OptionalConfig))
|
||||
|
||||
// Fill in defaults for missing fields
|
||||
dirName := filepath.Base(stackDir)
|
||||
if meta.Slug == "" {
|
||||
|
||||
Reference in New Issue
Block a user