Skip to content

Commit

Permalink
Python: Allow single file processing
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusWL committed Dec 8, 2023
1 parent 2c0bed1 commit de41f19
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion python/ql/src/meta/ClassHierarchy/process-mrva-results.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ def parse_from_file(path: Path) -> set:

def gather_from_bqrs_results():
with CodeQL() as codeql:
for f in glob.glob(f"{sys.argv[1]}/**.bqrs", recursive=True):
if os.path.exists(sys.argv[1]) and not os.path.isdir(sys.argv[1]) and sys.argv[1].endswith(".bqrs"):
files = [sys.argv[1]]
else:
files = glob.glob(f"{sys.argv[1]}/**.bqrs", recursive=True)

for f in files:
print(f"Processing {f}")

json_data = codeql.command(["bqrs", "decode", "--format=json", f])
Expand Down

0 comments on commit de41f19

Please sign in to comment.