File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -578,6 +578,24 @@ private bool RunEspTool(
578578 {
579579 appName = "esptool" ;
580580 appDir = Path . Combine ( Program . ExecutingPath , "esptool" , "esptoolLinux" ) ;
581+ Process espToolExex = new Process ( ) ;
582+ // Making sure the esptool is executable
583+ espToolExex . StartInfo = new ProcessStartInfo ( "chmod +x" , Path . Combine ( appDir , appName ) )
584+ {
585+ WorkingDirectory = appDir ,
586+ UseShellExecute = false ,
587+ RedirectStandardError = true ,
588+ RedirectStandardOutput = true
589+ } ;
590+ if ( ! espToolExex . Start ( ) )
591+ {
592+ throw new EspToolExecutionException ( "Error changing permissions for esptool!" ) ;
593+ }
594+
595+ while ( ! espToolExex . HasExited )
596+ {
597+ Thread . Sleep ( 10 ) ;
598+ }
581599 }
582600
583601 Process espTool = new Process ( ) ;
@@ -605,7 +623,7 @@ private bool RunEspTool(
605623 if ( ! espTool . Start ( ) )
606624 {
607625 throw new EspToolExecutionException ( "Error starting esptool!" ) ;
608- }
626+ }
609627
610628 var messageBuilder = new StringBuilder ( ) ;
611629
You can’t perform that action at this time.
0 commit comments