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

vweb: run vfmt, add it to v test-cleancode

This commit is contained in:
Delyan Angelov
2020-12-27 11:38:12 +02:00
parent 1b9d514275
commit d563261e58
8 changed files with 94 additions and 181 deletions

View File

@@ -77,16 +77,12 @@ fn (am AssetManager) combine(asset_type string, to_file bool) string {
if to_file {
return out_file
}
cached := os.read_file(out_file) or {
return ''
}
cached := os.read_file(out_file) or { return '' }
return cached
}
// rebuild
for asset in am.get_assets(asset_type) {
data := os.read_file(asset.file_path) or {
return ''
}
data := os.read_file(asset.file_path) or { return '' }
out += data
}
if am.minify {
@@ -100,13 +96,9 @@ fn (am AssetManager) combine(asset_type string, to_file bool) string {
return out
}
if !os.is_dir(am.cache_dir) {
os.mkdir(am.cache_dir) or {
panic(err)
}
}
mut file := os.create(out_file) or {
panic(err)
os.mkdir(am.cache_dir) or { panic(err) }
}
mut file := os.create(out_file) or { panic(err) }
file.write(out.bytes())
file.close()
return out_file