mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 17:55:01 +00:00
have io.write_text handle dry_run
This commit is contained in:
parent
b46dffbb20
commit
4ee5c49a04
2 changed files with 4 additions and 0 deletions
|
@ -101,6 +101,7 @@ class InputOutput:
|
|||
tool_output_color=None,
|
||||
tool_error_color="red",
|
||||
encoding="utf-8",
|
||||
dry_run=False,
|
||||
):
|
||||
no_color = os.environ.get("NO_COLOR")
|
||||
if no_color is not None and no_color != "":
|
||||
|
@ -144,6 +145,8 @@ class InputOutput:
|
|||
return
|
||||
|
||||
def write_text(self, filename, content):
|
||||
if self.dry_run:
|
||||
return
|
||||
with open(str(filename), "w", encoding=self.encoding) as f:
|
||||
f.write(content)
|
||||
|
||||
|
|
|
@ -252,6 +252,7 @@ def main(args=None, input=None, output=None):
|
|||
user_input_color=args.user_input_color,
|
||||
tool_output_color=args.tool_output_color,
|
||||
tool_error_color=args.tool_error_color,
|
||||
dry_run=args.dry_run,
|
||||
)
|
||||
|
||||
if args.verbose:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue