Skip to content

Commit

Permalink
debugging code, will remove
Browse files Browse the repository at this point in the history
  • Loading branch information
SamSaffron committed Feb 1, 2025
1 parent 0c5d8fb commit dab4f88
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions lib/ai_bot/artifact_update_strategies/diff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,19 @@ def apply_changes(changes)

content = source.public_send(section == :javascript ? :js : section)
blocks.each do |block|
content =
DiscourseAi::Utils::DiffUtils::SimpleDiff.apply(
content,
block[:search],
block[:replace],
)
begin
content =
DiscourseAi::Utils::DiffUtils::SimpleDiff.apply(
content,
block[:search],
block[:replace],
)
rescue StandardError => e
File.write("/tmp/x/content", content)
File.write("/tmp/x/search", block[:search])
File.write("/tmp/x/replace", block[:replace])
raise e
end
end
updated_content[section == :javascript ? :js : section] = content
end
Expand Down

0 comments on commit dab4f88

Please sign in to comment.