File tree Expand file tree Collapse file tree 4 files changed +35
-4
lines changed
Expand file tree Collapse file tree 4 files changed +35
-4
lines changed Original file line number Diff line number Diff line change 6161 - name : Install dependencies
6262 run : bun install
6363
64+ - name : Clean Output Directory
65+ run : |
66+ OUTPUT_DIR=src-tauri/gen/android/app/build/outputs/apk/universal/renamed
67+ rm -rf "$OUTPUT_DIR"
68+
6469 - name : Build split-ABI APKs
6570 run : bun tauri android build --apk --split-per-abi
6671
Original file line number Diff line number Diff line change 6060
6161 - name : Install dependencies
6262 run : bun install
63+
64+ - name : Clean Output Directory
65+ run : |
66+ OUTPUT_DIR=src-tauri/gen/android/app/build/outputs/apk/universal/renamed
67+ rm -rf "$OUTPUT_DIR"
6368
6469 - name : Build universal APK
6570 run : bun tauri android build
Original file line number Diff line number Diff line change 3535 - name : Install dependencies
3636 run : bun install
3737
38+ - name : Clean NSIS output folder
39+ shell : pwsh
40+ run : |
41+ $nsisPath = "src-tauri/target/release/bundle/nsis"
42+ if (Test-Path $nsisPath) {
43+ Remove-Item -Recurse -Force $nsisPath
44+ }
45+
46+
3847 - name : Build Windows installer
3948 run : bun tauri build
4049
Original file line number Diff line number Diff line change @@ -3,14 +3,26 @@ use std::path::PathBuf;
33pub fn new ( file_path : & PathBuf ) -> Result < String , String > {
44 #[ cfg( any( windows, target_os = "android" ) ) ]
55 let base = "http://asset.localhost/" ;
6+
67 #[ cfg( not( any( windows, target_os = "android" ) ) ) ]
78 let base = "asset://localhost/" ;
89
9- let path = dunce:: canonicalize ( file_path) . map_err ( |e| e. to_string ( ) ) ?;
10- let path_to_string = path. display ( ) . to_string ( ) ;
11- let encoded = urlencoding:: encode ( & path_to_string) ;
10+ // Windows/Android: canonicalize for absolute path resolution
11+ #[ cfg( any( windows, target_os = "android" ) ) ]
12+ let path_str = {
13+ let path = dunce:: canonicalize ( file_path) . map_err ( |e| e. to_string ( ) ) ?;
14+ path. display ( ) . to_string ( )
15+ } ;
16+
17+ // Linux/macOS: use raw path, strip leading slash
18+ #[ cfg( not( any( windows, target_os = "android" ) ) ) ]
19+ let path_str = {
20+ let raw = file_path. display ( ) . to_string ( ) ;
21+ raw. trim_start_matches ( '/' ) . to_string ( )
22+ } ;
1223
24+ let encoded = urlencoding:: encode ( & path_str) ;
1325 let url = format ! ( "{base}{encoded}" ) ;
1426
15- return Ok ( url) ;
27+ Ok ( url)
1628}
You can’t perform that action at this time.
0 commit comments