Skip to content

Commit fc9ebe7

Browse files
committed
Fix error with index --dry-run flag when index doesn't exist
* bdx/index.py (index_binary_directory): Only make the index readonly if it exists.
1 parent 8cd87ed commit fc9ebe7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bdx/index.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,9 @@ def index_binary_directory(
10841084

10851085
bindir_path = Path(directory)
10861086

1087-
with SymbolIndex.open(index_path, readonly=dry_run) as index:
1087+
with SymbolIndex.open(
1088+
index_path, readonly=dry_run and index_path.exists()
1089+
) as index:
10881090
if index.binary_dir() is None and not dry_run:
10891091
index.set_binary_dir(bindir_path)
10901092

0 commit comments

Comments
 (0)