Skip to content

Commit de41f19

Browse files
committed
Python: Allow single file processing
1 parent 2c0bed1 commit de41f19

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

python/ql/src/meta/ClassHierarchy/process-mrva-results.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,12 @@ def parse_from_file(path: Path) -> set:
8484

8585
def gather_from_bqrs_results():
8686
with CodeQL() as codeql:
87-
for f in glob.glob(f"{sys.argv[1]}/**.bqrs", recursive=True):
87+
if os.path.exists(sys.argv[1]) and not os.path.isdir(sys.argv[1]) and sys.argv[1].endswith(".bqrs"):
88+
files = [sys.argv[1]]
89+
else:
90+
files = glob.glob(f"{sys.argv[1]}/**.bqrs", recursive=True)
91+
92+
for f in files:
8893
print(f"Processing {f}")
8994

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

0 commit comments

Comments
 (0)