[buildcore] Fix pybb mkdir

This commit is contained in:
2022-02-16 20:12:45 -06:00
parent b7f726f4fd
commit ff5b7577a4
2 changed files with 9 additions and 4 deletions

View File

@ -31,9 +31,15 @@ def cat(paths: str) -> int:
def mkdir(path: str) -> int:
if not os.path.exists(path) and os.path.isdir(path):
os.mkdir(path)
return 0
if not os.path.exists(path):
try:
os.mkdir(path)
except:
return 1
return 0
if os.path.isdir(path):
return 0
return 1
# this exists because Windows is utterly incapable of providing a proper rm -rf