@@ -284,7 +284,9 @@ private void createAndUpload(){
284284 System .out .println ("[SPIFFS] block : " +spiBlock );
285285
286286 try {
287- if (listenOnProcess (new String []{toolPath , "-c" , dataPath , "-p" , spiPage +"" , "-b" , spiBlock +"" , "-s" , (spiEnd - spiStart )+"" , imagePath }) != 0 ){
287+ String [] buildCmd = new String []{toolPath , "-c" , dataPath , "-p" , spiPage +"" , "-b" , spiBlock +"" , "-s" , (spiEnd - spiStart )+"" , imagePath };
288+ dumpCommand (buildCmd , "build.verbose" );
289+ if (listenOnProcess (buildCmd ) != 0 ){
288290 System .err .println ();
289291 editor .statusError ("SPIFFS Create Failed!" );
290292 return ;
@@ -298,6 +300,7 @@ private void createAndUpload(){
298300 editor .statusNotice ("SPIFFS Uploading Image..." );
299301 System .out .println ("[SPIFFS] upload : " +imagePath );
300302
303+ String [] uploadCmd ;
301304 if (isNetwork ){
302305 String pythonCmd ;
303306 if (PreferencesData .get ("runtime.os" ).contentEquals ("windows" ))
@@ -307,18 +310,35 @@ private void createAndUpload(){
307310
308311 System .out .println ("[SPIFFS] IP : " +serialPort );
309312 System .out .println ();
310- sysExec ( new String []{pythonCmd , espota .getAbsolutePath (), "-i" , serialPort , "-s" , "-f" , imagePath }) ;
313+ uploadCmd = new String []{pythonCmd , espota .getAbsolutePath (), "-i" , serialPort , "-s" , "-f" , imagePath };
311314 } else {
312315 System .out .println ("[SPIFFS] address: " +uploadAddress );
313316 System .out .println ("[SPIFFS] reset : " +resetMethod );
314317 System .out .println ("[SPIFFS] port : " +serialPort );
315318 System .out .println ("[SPIFFS] speed : " +uploadSpeed );
316319 System .out .println ();
317- sysExec ( new String []{esptool .getAbsolutePath (), "-cd" , resetMethod , "-cb" , uploadSpeed , "-cp" , serialPort , "-ca" , uploadAddress , "-cf" , imagePath }) ;
320+ uploadCmd = new String []{esptool .getAbsolutePath (), "-cd" , resetMethod , "-cb" , uploadSpeed , "-cp" , serialPort , "-ca" , uploadAddress , "-cf" , imagePath };
318321 }
322+ dumpCommand (uploadCmd , "upload.verbose" );
323+ sysExec (uploadCmd );
319324 }
320325
321326 public void run () {
322327 createAndUpload ();
323328 }
329+
330+ private void dumpCommand (String [] fragments , String preference ) {
331+ if (!PreferencesData .getBoolean (preference )) {
332+ return ;
333+ }
334+
335+ StringBuffer commandBuf = new StringBuffer (128 );
336+ for (int cnt = 0 ; cnt < fragments .length ; cnt ++) {
337+ commandBuf .append (fragments [cnt ]);
338+ if (cnt < fragments .length - 1 ) {
339+ commandBuf .append (" " );
340+ }
341+ }
342+ System .out .println (commandBuf .toString ());
343+ }
324344}
0 commit comments