stevegeek / ai_refactor

AI Refactor is an experimental tool to see how AI can be applied to bulk refactor code.
MIT License
31 stars 3 forks source link

Exit code doesn't appear to reflect successful execution #9

Closed dbackeus closed 1 week ago

dbackeus commented 1 week ago

I tried to wrap execution of the CLI in another Ruby script:

system("bundle exec ai_refactor ruby/refactor_ruby #{file} -p ai-refactor-prompt -m claude-3-5-sonnet-20240620 --overwrite y -O #{file}") or abort("Refactor failed")

Even when getting a successful execution I hit "Refactor failed" and abort the script:

Screenshot 2024-06-24 at 13 41 04