We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
exist_ok=True
1 parent 3de1378 commit f65f120Copy full SHA for f65f120
shiny/_main_create.py
@@ -775,8 +775,7 @@ def copy_template_files(
775
)
776
sys.exit(1)
777
778
- if not dest_dir.exists():
779
- dest_dir.mkdir()
+ dest_dir.mkdir(parents=True, exist_ok=True)
780
781
for item in template.path.iterdir():
782
if item.is_file():
shiny/bookmark/_bookmark_state.py
@@ -12,8 +12,7 @@ def _local_dir(id: str) -> Path:
12
13
async def local_save_dir(id: str) -> Path:
14
state_dir = _local_dir(id)
15
- if not state_dir.exists():
16
- state_dir.mkdir(parents=True)
+ state_dir.mkdir(parents=True, exist_ok=True)
17
return state_dir
18
19
0 commit comments