Skip to content

Commit a2fdf7b

Browse files
committed
Fix exception in ensure_dir
1 parent f812c70 commit a2fdf7b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

microesc/common.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33

44
import yaml
55

6-
def ensure_dir(path):
7-
if not os.path.exists(path):
8-
os.makedirs(path)
6+
def ensure_dir(directory):
7+
if not os.path.exists(directory):
8+
os.makedirs(directory)
9+
10+
11+
def ensure_dir_for_file(path):
12+
directory = os.path.dirname(path)
13+
ensure_dir(directory)
914

1015
def ensure_directories(*dirs):
1116
for dir in dirs:

0 commit comments

Comments
 (0)