vweb: fix typo in 'assets.v'

pull/3699/head
Major Taylor 2020-02-07 17:12:30 -05:00 committed by GitHub
parent 8f9979eb8d
commit e9827f5a34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -87,7 +87,7 @@ fn (am mut AssetManager) combine(asset_type string, to_file bool) string {
} }
// rebuild // rebuild
for asset in am.get_assets(asset_type) { for asset in am.get_assets(asset_type) {
mut data := os.read_file(asset.file_path) or { data := os.read_file(asset.file_path) or {
return '' return ''
} }
out += data out += data
@ -118,8 +118,8 @@ fn (am mut AssetManager) get_cache_key(asset_type string) string {
mut latest_modified := 0 mut latest_modified := 0
for asset in am.get_assets(asset_type) { for asset in am.get_assets(asset_type) {
files_salt += asset.file_path files_salt += asset.file_path
if asset.last_modified.uni > latest_modified { if asset.last_modified.unix > latest_modified {
latest_modified = asset.last_modified.uni latest_modified = asset.last_modified.unix
} }
} }
hash := md5.sum(files_salt.bytes()).hex() hash := md5.sum(files_salt.bytes()).hex()
@ -159,7 +159,7 @@ fn (am mut AssetManager) add(asset_type, file string) bool {
} }
asset := Asset{ asset := Asset{
file_path: file file_path: file
last_modified: time.Time{uni: os.file_last_mod_unix(file)} last_modified: time.Time{unix: os.file_last_mod_unix(file)}
} }
if asset_type == 'css' { if asset_type == 'css' {
am.css << asset am.css << asset