aics / agent /fixer.py
akborana4's picture
Create agent/fixer.py
da36569 verified
raw
history blame contribute delete
334 Bytes
from agent.file_ops import read, write
def fixer(issues, ws):
app = f"{ws}/src/App.jsx"
code = read(app)
if "theme" in issues:
code = code.replace("<h1>", "<div style={{background:'#111',color:'#fff'}}><h1>") + "</div>"
if "runtime" in issues:
code += "\n// auto runtime fix\n"
write(app, code)