From 8ca438592e907868d8c919778bd5660174c5d8d2 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 16 Nov 2024 14:00:36 +0200 Subject: [PATCH] assets: workaround for a V issue https://github.com/vlang/v/issues/22873, restoring the ability to `v -g .` apps using Shy --- lib/assets.v | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/lib/assets.v b/lib/assets.v index 763f605..3c9a25c 100644 --- a/lib/assets.v +++ b/lib/assets.v @@ -402,44 +402,39 @@ pub fn (mut a Assets) update() { if a.async_load_queue.len > 0 { alo := a.async_load_queue.pop() source := alo.source - path := match source { + mut path := '' + match source { string { $if android && !termux { if !source.starts_with('/') { - 'file://${source}' + path = 'file://${source}' } else { eprintln('${@STRUCT}.${@FN}: error converting "${source}" (Android) to `fetch` compatible source"') - '' } } $else { if os.is_file(source) { - 'file://${source}' + path = 'file://${source}' } else { eprintln('${@STRUCT}.${@FN}: error converting "${source}" to `fetch` compatible source"') - '' } } } TaggedSource { $if android && !termux { if !source.str().starts_with('/') { - 'file://${source.str()}' + path = 'file://${source.str()}' } else { eprintln('${@STRUCT}.${@FN}: error converting "${source.str()}" (Android) to `fetch` compatible source"') - '' } } $else { if os.is_file(source.str()) { - 'file://${source.str()}' + path = 'file://${source.str()}' } else { eprintln('${@STRUCT}.${@FN}: error converting "${source.str()}" to `fetch` compatible source"') - '' } } } - else { - '' - } + else {} } if path != '' { // println('loading ${path}')