feature/recipe_implementation #5
@ -1,7 +1,7 @@
|
|||||||
package recipe
|
package recipe
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
_ "bufio"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
@ -99,7 +99,7 @@ func (r *Runner) discoverFiles() []string {
|
|||||||
return files
|
return files
|
||||||
}
|
}
|
||||||
|
|
||||||
// handleApplyStep with flexible regex that matches Grok's current output style
|
// handleApplyStep with robust regex that matches Grok's current output
|
||||||
func (r *Runner) handleApplyStep(previousResults []string) {
|
func (r *Runner) handleApplyStep(previousResults []string) {
|
||||||
if len(previousResults) == 0 {
|
if len(previousResults) == 0 {
|
||||||
fmt.Println(" ⚠️ No previous results to apply — skipping.")
|
fmt.Println(" ⚠️ No previous results to apply — skipping.")
|
||||||
@ -124,8 +124,8 @@ func (r *Runner) handleApplyStep(previousResults []string) {
|
|||||||
fmt.Println(" Review it, then run with dry_run=false to apply.")
|
fmt.Println(" Review it, then run with dry_run=false to apply.")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flexible regex — matches both old and new Grok formats
|
// Double-quoted regex — no raw-string backtick problems ever again
|
||||||
var blockRe = regexp.MustCompile(`(?s)```go\n(?://\s*)?(.+?\.go)\n(.*?)\n````)
|
var blockRe = regexp.MustCompile(`(?s)```go\n// \s*(.+?\.go)\n(.*?)\n````)
|
||||||
|
|
||||||
func extractCodeBlocks(text string) map[string]string {
|
func extractCodeBlocks(text string) map[string]string {
|
||||||
blocks := make(map[string]string)
|
blocks := make(map[string]string)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user