{
"event": "PreToolUse",
"tool_name": "Bash",
"tool_input": {
"command": "find \/var\/www\/migration\/content-pipeline\/src -name \"*.py\" -not -name \"*.bak\" -exec grep -l 'sys.path.insert(0, \"\/var\/www\/scripts\/pipeline\")' {} \\; | while read f; do\n sed -i 's|sys.path.insert(0, \"\/var\/www\/scripts\/pipeline\")|sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))|g' \"$f\"\n # Ensure os is imported\n if ! grep -q \"^import os\" \"$f\"; then\n sed -i '1a import os' \"$f\"\n fi\ndone && echo \"Fixed $(find \/var\/www\/migration\/content-pipeline\/src -name \"*.py\" -not -name \"*.bak\" -exec grep -l 'sys.path.insert' {} \\; | wc -l) files\"",
"description": "Fix all hardcoded sys.path.insert statements"
}
}