Skip to content

Commit

Permalink
package: do not panic if mipmap/icon.png can not be removed (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
larpon authored Oct 11, 2024
1 parent ca091e6 commit f3d184b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions android/package.v
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import os
import regex
import semver
import vab.java
import vab.paths
import vab.util as vabutil
import vab.android.env
import vab.android.sdk
Expand Down Expand Up @@ -1173,14 +1174,16 @@ fn prepare_base(opt PackageOptions) (string, string) {
opt.verbose(1, 'Copying assets...')

if !is_default_pkg_id && os.is_file(opt.icon) && os.file_ext(opt.icon) == '.png' {
icon_path := os.join_path(package_path, 'res', 'mipmap', 'icon.png')
icon_path := os.join_path(package_path, 'res', 'mipmap')
paths.ensure(icon_path) or { panic(err) }
icon_file := os.join_path(icon_path, 'icon.png')
opt.verbose(1, 'Copying icon...')
os.rm(icon_path) or { panic(err) }
os.cp(opt.icon, icon_path) or { panic(err) }
os.rm(icon_file) or {}
os.cp(opt.icon, icon_file) or { panic(err) }
}

assets_path := os.join_path(package_path, 'assets')
os.mkdir_all(assets_path) or { panic(err) }
paths.ensure(assets_path) or { panic(err) }

mut included_asset_paths := []string{}

Expand Down

0 comments on commit f3d184b

Please sign in to comment.