Skip to content

Commit

Permalink
assets: workaround for a V issue vlang/v#22873, restoring the ability…
Browse files Browse the repository at this point in the history
… to `v -g .` apps using Shy
  • Loading branch information
spytheman committed Nov 16, 2024
1 parent d65ed81 commit 8ca4385
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions lib/assets.v
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
Expand Down

0 comments on commit 8ca4385

Please sign in to comment.