File tree Expand file tree Collapse file tree 4 files changed +29
-6
lines changed
Expand file tree Collapse file tree 4 files changed +29
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " tauri-cli " : patch:bug
3+ " @tauri-apps/cli " : patch:bug
4+ ---
5+
6+ Exit ` beforeDevCommand ` process if the android or iOS ` dev ` command fails.
Original file line number Diff line number Diff line change @@ -448,10 +448,11 @@ fn check_for_updates() -> Result<()> {
448448pub fn kill_before_dev_process ( ) {
449449 if let Some ( child) = BEFORE_DEV . get ( ) {
450450 let child = child. lock ( ) . unwrap ( ) ;
451- KILL_BEFORE_DEV_FLAG
452- . get ( )
453- . unwrap ( )
454- . store ( true , Ordering :: Relaxed ) ;
451+ let kill_before_dev_flag = KILL_BEFORE_DEV_FLAG . get ( ) . unwrap ( ) ;
452+ if kill_before_dev_flag. load ( Ordering :: Relaxed ) {
453+ return ;
454+ }
455+ kill_before_dev_flag. store ( true , Ordering :: Relaxed ) ;
455456 #[ cfg( windows) ]
456457 {
457458 let powershell_path = std:: env:: var ( "SYSTEMROOT" ) . map_or_else (
Original file line number Diff line number Diff line change @@ -96,7 +96,15 @@ impl From<Options> for DevOptions {
9696 }
9797}
9898
99- pub fn command ( mut options : Options , noise_level : NoiseLevel ) -> Result < ( ) > {
99+ pub fn command ( options : Options , noise_level : NoiseLevel ) -> Result < ( ) > {
100+ let result = run_command ( options, noise_level) ;
101+ if result. is_err ( ) {
102+ crate :: dev:: kill_before_dev_process ( ) ;
103+ }
104+ result
105+ }
106+
107+ fn run_command ( mut options : Options , noise_level : NoiseLevel ) -> Result < ( ) > {
100108 delete_codegen_vars ( ) ;
101109
102110 let ( merge_config, _merge_config_path) = resolve_merge_config ( & options. config ) ?;
Original file line number Diff line number Diff line change @@ -83,7 +83,15 @@ impl From<Options> for DevOptions {
8383 }
8484}
8585
86- pub fn command ( mut options : Options , noise_level : NoiseLevel ) -> Result < ( ) > {
86+ pub fn command ( options : Options , noise_level : NoiseLevel ) -> Result < ( ) > {
87+ let result = run_command ( options, noise_level) ;
88+ if result. is_err ( ) {
89+ crate :: dev:: kill_before_dev_process ( ) ;
90+ }
91+ result
92+ }
93+
94+ fn run_command ( mut options : Options , noise_level : NoiseLevel ) -> Result < ( ) > {
8795 if var_os ( APPLE_DEVELOPMENT_TEAM_ENV_VAR_NAME ) . is_none ( ) {
8896 if let Ok ( teams) = find_development_teams ( ) {
8997 let index = match teams. len ( ) {
You can’t perform that action at this time.
0 commit comments