vweb assets: the assets cache files are now immutable after creation. (#1454)

pull/1456/head
Delyan Angelov 2019-08-03 15:16:26 +03:00 committed by joe-conigliaro
parent 45e76609b0
commit 93d27b0b9f
1 changed files with 4 additions and 4 deletions

View File

@ -77,13 +77,13 @@ fn (am mut AssetManager) combine(asset_type string, to_file bool) string {
mut out := ''
// use cache
if os.file_exists(out_file) {
if to_file {
return out_file
}
cached := os.read_file(out_file) or {
return ''
}
out = cached
if !to_file {
return out
}
return cached
}
// rebuild
for asset in am.get_assets(asset_type) {