1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

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

This commit is contained in:
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

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) }
}
}
}
}