24 lines
736 B
Python
24 lines
736 B
Python
#!/usr/bin/env python3
|
|
|
|
path = "/workspace/skills/bms/scripts/bms-tickets.sh"
|
|
with open(path, "r") as f:
|
|
lines = f.readlines()
|
|
|
|
# Find the line that is exactly ' local sep=""\n'
|
|
for i, line in enumerate(lines):
|
|
if line.strip() == 'local sep=""':
|
|
insert_idx = i + 1
|
|
new_lines = [
|
|
' if [[ "$status" == "open" ]]; then\n',
|
|
' filter+="\\"StatusNames\\":\\"Escalated,Open,Waiting for Customer,Waiting for Product(s),Waiting for Vendor\\""\n',
|
|
' sep=","\n',
|
|
' status=""\n',
|
|
' fi\n',
|
|
]
|
|
lines[insert_idx:insert_idx] = new_lines
|
|
break
|
|
|
|
with open(path, "w") as f:
|
|
f.writelines(lines)
|
|
print("Patched after local sep line")
|