@@ -284,7 +284,9 @@ private void createAndUpload(){
284
284
System .out .println ("[SPIFFS] block : " +spiBlock );
285
285
286
286
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 ){
288
290
System .err .println ();
289
291
editor .statusError ("SPIFFS Create Failed!" );
290
292
return ;
@@ -298,6 +300,7 @@ private void createAndUpload(){
298
300
editor .statusNotice ("SPIFFS Uploading Image..." );
299
301
System .out .println ("[SPIFFS] upload : " +imagePath );
300
302
303
+ String [] uploadCmd ;
301
304
if (isNetwork ){
302
305
String pythonCmd ;
303
306
if (PreferencesData .get ("runtime.os" ).contentEquals ("windows" ))
@@ -307,18 +310,35 @@ private void createAndUpload(){
307
310
308
311
System .out .println ("[SPIFFS] IP : " +serialPort );
309
312
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 };
311
314
} else {
312
315
System .out .println ("[SPIFFS] address: " +uploadAddress );
313
316
System .out .println ("[SPIFFS] reset : " +resetMethod );
314
317
System .out .println ("[SPIFFS] port : " +serialPort );
315
318
System .out .println ("[SPIFFS] speed : " +uploadSpeed );
316
319
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 };
318
321
}
322
+ dumpCommand (uploadCmd , "upload.verbose" );
323
+ sysExec (uploadCmd );
319
324
}
320
325
321
326
public void run () {
322
327
createAndUpload ();
323
328
}
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
+ }
324
344
}
0 commit comments