mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-20 12:24:59 +00:00
refactor: Remove 'env' key from .cast file header
This commit is contained in:
parent
3a837c472e
commit
a24ff28031
1 changed files with 9 additions and 2 deletions
|
@ -42,8 +42,15 @@ def process_file(input_path, output_path):
|
|||
open(output_path, "w", encoding="utf-8") as outfile,
|
||||
):
|
||||
for line in infile:
|
||||
# Always include the header (first line)
|
||||
# Process the header (first line)
|
||||
if is_first_line:
|
||||
try:
|
||||
header = json.loads(line)
|
||||
if 'env' in header:
|
||||
del header['env']
|
||||
outfile.write(json.dumps(header) + "\n")
|
||||
except json.JSONDecodeError:
|
||||
# If we can't parse the header, keep it as is
|
||||
outfile.write(line)
|
||||
is_first_line = False
|
||||
continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue