Skip to content

Commit

Permalink
EH-272 better resolution to parsing bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
kgfoundrydig committed Jan 10, 2022
1 parent 24d7805 commit 99d5c44
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions review.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,17 +378,14 @@ def main(
# unless it's '.', in which case use all of directory
if original_directory.endswith(args.build_dir):
build_dir_index = -(len(args.build_dir) + 1)
basedir = original_directory[:build_dir_index]
elif args.build_dir == ".":
if (original_directory.endswith("/")):
build_dir_index = -1
else:
build_dir_index = len(original_directory) + 1
basedir = original_directory
else:
raise RuntimeError(
f"compile_commands.json contains absolute paths that I don't know how to deal with: '{original_directory}'"
)

basedir = original_directory[:build_dir_index]
newbasedir = os.getcwd()

print(f"Replacing '{basedir}' with '{newbasedir}'", flush=True)
Expand Down

0 comments on commit 99d5c44

Please sign in to comment.