Files
Brancheneinstufung2/patch_syntax.py

17 lines
547 B
Python

import sys
with open('fotograf-de-scraper/frontend/src/App.tsx', 'r') as f:
content = f.read()
# Fix the syntax error: '? .replace' should be '? selectedJob.name.replace'
old_syntax = "? .replace(/\\(JOB\\d+\\)/gi, '')"
new_syntax = "? selectedJob.name.replace(/\\(JOB\\d+\\)/gi, '')"
if old_syntax in content:
content = content.replace(old_syntax, new_syntax)
with open('fotograf-de-scraper/frontend/src/App.tsx', 'w') as f:
f.write(content)
print("Syntax error fixed")
else:
print("Syntax error string not found")