From 2ed5e45677351a1870e66e4daece1d2ab7e81517 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 23 May 2024 14:01:45 -0700 Subject: [PATCH] fixed #603 --- aider/commands.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/aider/commands.py b/aider/commands.py index cf52c1d18..c42e52c61 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -441,8 +441,14 @@ class Commands: continue if self.io.confirm_ask(f"No files matched '{word}'. Do you want to create {fname}?"): - fname.touch() - all_matched_files.add(str(fname)) + if "*" in str(fname) or "?" in str(fname): + self.io.tool_error(f"Cannot create file with wildcard characters: {fname}") + else: + try: + fname.touch() + all_matched_files.add(str(fname)) + except OSError as e: + self.io.tool_error(f"Error creating file {fname}: {e}") for matched_file in all_matched_files: abs_file_path = self.coder.abs_root_path(matched_file)