File tree Expand file tree Collapse file tree 5 files changed +29
-4
lines changed
Expand file tree Collapse file tree 5 files changed +29
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @tauri-apps/cli " : patch:enhance
3+ " tauri-cli " : patch:enhance
4+ ---
5+
6+ Added the ` log ` plugin to the app template, which is required to visualize logs on Android and iOS.
Original file line number Diff line number Diff line change @@ -196,15 +196,15 @@ pub fn command(mut options: Options) -> Result<()> {
196196 template_target_path
197197 ) ;
198198 } else {
199- let ( tauri_dep, tauri_build_dep) = if let Some ( tauri_path) = options. tauri_path {
199+ let ( tauri_dep, tauri_build_dep) = if let Some ( tauri_path) = & options. tauri_path {
200200 (
201201 format ! (
202202 r#"{{ path = {:?} }}"# ,
203- resolve_tauri_path( & tauri_path, "crates/tauri" )
203+ resolve_tauri_path( tauri_path, "crates/tauri" )
204204 ) ,
205205 format ! (
206206 "{{ path = {:?} }}" ,
207- resolve_tauri_path( & tauri_path, "crates/tauri-build" )
207+ resolve_tauri_path( tauri_path, "crates/tauri-build" )
208208 ) ,
209209 )
210210 } else {
@@ -220,6 +220,9 @@ pub fn command(mut options: Options) -> Result<()> {
220220
221221 let mut data = BTreeMap :: new ( ) ;
222222 data. insert ( "tauri_dep" , to_json ( tauri_dep) ) ;
223+ if options. tauri_path . is_some ( ) {
224+ data. insert ( "patch_tauri_dep" , to_json ( true ) ) ;
225+ }
223226 data. insert ( "tauri_build_dep" , to_json ( tauri_build_dep) ) ;
224227 data. insert (
225228 "frontend_dist" ,
Original file line number Diff line number Diff line change @@ -20,4 +20,10 @@ tauri-build = {{ tauri_build_dep }}
2020[dependencies]
2121serde_json = "1.0"
2222serde = { version = "1.0", features = ["derive"] }
23+ log = "0.4"
2324tauri = {{ tauri_dep }}
25+ tauri-plugin-log = "2.0.0-rc"
26+ {{#if patch_tauri_dep}}
27+ [patch.crates-io]
28+ tauri = {{ tauri_dep }}
29+ {{/if}}
Original file line number Diff line number Diff line change 11#[ cfg_attr( mobile, tauri:: mobile_entry_point) ]
22pub fn run ( ) {
33 tauri:: Builder :: default ( )
4+ . setup ( |app| {
5+ if cfg ! ( debug_assertions) {
6+ app. handle ( ) . plugin (
7+ tauri_plugin_log:: Builder :: default ( )
8+ . level ( log:: LevelFilter :: Info )
9+ . build ( ) ,
10+ ) ?;
11+ }
12+ Ok ( ( ) )
13+ } )
414 . run ( tauri:: generate_context!( ) )
515 . expect ( "error while running tauri application" ) ;
616}
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ pub fn restart(env: &Env) -> ! {
9292}
9393
9494#[ cfg( target_os = "macos" ) ]
95- fn restart_macos_app ( current_binary : & PathBuf , env : & Env ) {
95+ fn restart_macos_app ( current_binary : & std :: path :: Path , env : & Env ) {
9696 use std:: process:: { exit, Command } ;
9797
9898 if let Some ( macos_directory) = current_binary. parent ( ) {
You can’t perform that action at this time.
0 commit comments