vdoc: fix output folder creation (#9699)

pull/9701/head
Lukas Neubert 2021-04-12 14:59:40 +02:00 committed by GitHub
parent 6b8585daea
commit 9427c5f526
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -338,11 +338,10 @@ fn (mut vd VDoc) generate_docs_from_file() {
println(outputs[first]) println(outputs[first])
} }
} else { } else {
if !os.is_dir(out.path) {
out.path = os.real_path('.')
}
if !os.exists(out.path) { if !os.exists(out.path) {
os.mkdir(out.path) or { panic(err) } os.mkdir_all(out.path) or { panic(err) }
} else if !os.is_dir(out.path) {
out.path = os.real_path('.')
} }
if cfg.is_multi { if cfg.is_multi {
out.path = os.join_path(out.path, '_docs') out.path = os.join_path(out.path, '_docs')