Fixed a bug in Coder class where the common root directory was not being set correctly.

This commit is contained in:
Paul Gauthier 2023-05-11 16:54:10 -07:00
parent 46cd8362b6
commit 173a91a8c2

View file

@ -59,10 +59,12 @@ class Coder:
self.show_diffs = show_diffs
def find_common_root(self):
if not self.abs_fnames:
if self.abs_fnames:
common_prefix = os.path.commonpath(list(self.abs_fnames))
self.root = os.path.dirname(common_prefix)
else:
self.root = os.getcwd()
common_prefix = os.path.commonpath(list(self.abs_fnames))
self.root = os.path.dirname(common_prefix)
self.console.print(f"[bright_black]Common root directory: {self.root}")
def set_repo(self, cmd_line_fnames):