Skip to content

Commit 7b1fde4

Browse files
Apply suggestions from code review
Co-authored-by: Bartek Boczek <[email protected]>
1 parent d6fd622 commit 7b1fde4

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/rai_whoami/rai_whoami/initialize_docs_directory.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,15 @@
2323
]
2424

2525

26-
def initialize_docs_directory(args: argparse.Namespace) -> None:
27-
documentation_dir = Path(args.documentation_dir)
28-
if os.path.exists(documentation_dir):
26+
def initialize_docs_directory(documentation_dir: Path) -> None:
27+
if documentation_dir.is_dir():
2928
print(
3029
f"Directory {documentation_dir} already exists. Remove it or use different folder."
3130
)
3231
return
3332

34-
os.makedirs(documentation_dir)
35-
print(f"Initialized documentation directory at {documentation_dir}")
3633
for subdirectory in SUBDIRECTORIES:
37-
os.makedirs(documentation_dir / subdirectory)
34+
(documentation_dir / subdirectory).mkdir(parents=True)
3835
print(
3936
f"Initialized subdirectory {subdirectory} at {documentation_dir / subdirectory}"
4037
)

0 commit comments

Comments
 (0)