@@ -206,7 +206,7 @@ private void createAndUpload(){
206
206
String espotaCmd = "espota.py" ;
207
207
if (PreferencesData .get ("runtime.os" ).contentEquals ("windows" ))
208
208
espotaCmd = "espota.exe" ;
209
-
209
+
210
210
Boolean isNetwork = false ;
211
211
File espota = new File (platform .getFolder ()+"/tools" );
212
212
File esptool = new File (platform .getFolder ()+"/tools" );
@@ -217,23 +217,32 @@ private void createAndUpload(){
217
217
editor .statusError ("Partitions Not Defined for " +BaseNoGui .getBoardPreferences ().get ("name" ));
218
218
return ;
219
219
}
220
-
221
- try {
222
- partitions = BaseNoGui .getBoardPreferences ().get ("build.partitions" );
223
- if (partitions == null || partitions .contentEquals ("" )){
224
- editor .statusError ("Partitions Not Found for " +BaseNoGui .getBoardPreferences ().get ("name" ));
225
- return ;
226
- }
227
- } catch (Exception e ){
228
- editor .statusError (e );
229
- return ;
230
- }
231
220
232
- File partitionsFile = new File (platform .getFolder () + "/tools/partitions" , partitions + ".csv" );
233
- if (!partitionsFile .exists () || !partitionsFile .isFile ()) {
234
- System .err .println ();
235
- editor .statusError (typefs + " Error: partitions file " + partitions + ".csv not found!" );
236
- return ;
221
+ File partitionsFile = new File (editor .getSketch ().getFolder (), "partitions.csv" );
222
+
223
+ if (partitionsFile .exists () && partitionsFile .isFile ()) {
224
+ System .out .println ("Using partitions.csv from sketch folder." );
225
+
226
+ } else {
227
+ System .out .println ("Using partition scheme from Arduino IDE." );
228
+ try {
229
+ partitions = BaseNoGui .getBoardPreferences ().get ("build.partitions" );
230
+ if (partitions == null || partitions .contentEquals ("" )){
231
+ editor .statusError ("Partitions Not Found for " +BaseNoGui .getBoardPreferences ().get ("name" ));
232
+ return ;
233
+ }
234
+ } catch (Exception e ){
235
+ editor .statusError (e );
236
+ return ;
237
+ }
238
+
239
+ partitionsFile = new File (platform .getFolder () + "/tools/partitions" , partitions + ".csv" );
240
+
241
+ if (!partitionsFile .exists () || !partitionsFile .isFile ()) {
242
+ System .err .println ();
243
+ editor .statusError (typefs + " Error: partitions file " + partitions + ".csv not found!" );
244
+ return ;
245
+ }
237
246
}
238
247
239
248
try {
0 commit comments