vdoc: fix panic on running `v doc -all -m vlib/ -f html -inline-assets` two times in a row

pull/9844/head
Delyan Angelov 2021-04-21 14:32:34 +03:00
parent 7b8957b25e
commit 6e589e2ae8
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
1 changed files with 4 additions and 1 deletions

View File

@ -349,7 +349,10 @@ fn (mut vd VDoc) generate_docs_from_file() {
os.mkdir(out.path) or { panic(err) }
} else {
for fname in css_js_assets {
os.rm(os.join_path(out.path, fname)) or { panic(err) }
existing_asset_path := os.join_path(out.path, fname)
if os.exists(existing_asset_path) {
os.rm(existing_asset_path) or { panic(err) }
}
}
}
}