From 4e4e58af833a2862fb3ee9c7b4884c9c4cec5cb2 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Thu, 16 Oct 2025 14:20:58 +0200 Subject: [PATCH] Hallucinate a fix to -from --- instruction.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/instruction.go b/instruction.go index cb91e45..791ed8e 100644 --- a/instruction.go +++ b/instruction.go @@ -270,17 +270,25 @@ func ParseYAMLFile(filename, workdir string) ([]LinkInstruction, error) { return nil, fmt.Errorf("error reading YAML file: %w", err) } - // First try to parse as a list of link instructions + // First try to parse as a YAMLConfig with links and from fields var config YAMLConfig err = yaml.Unmarshal(data, &config) - if err != nil || len(config.Links) == 0 { + LogInfo("First parsing attempt: err=%v, links=%d, from=%d", err, len(config.Links), len(config.From)) + if err != nil { // If that fails, try parsing as a direct list of instructions var instructions []LinkInstruction err = yaml.Unmarshal(data, &instructions) if err != nil { return nil, fmt.Errorf("error parsing YAML: %w", err) } - config.Links = instructions + // Filter out invalid instructions (empty source) + validInstructions := []LinkInstruction{} + for _, instr := range instructions { + if instr.Source != "" { + validInstructions = append(validInstructions, instr) + } + } + config.Links = validInstructions } expanded := []LinkInstruction{}