File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -2483,6 +2483,17 @@ public void handleAddLibrary() {
2483
2483
return ;
2484
2484
}
2485
2485
2486
+ String [] headers ;
2487
+ if (new File (libFolder , "library.properties" ).exists ()) {
2488
+ headers = BaseNoGui .headerListFromIncludePath (UserLibrary .create (libFolder ).getSrcFolder ());
2489
+ } else {
2490
+ headers = BaseNoGui .headerListFromIncludePath (libFolder );
2491
+ }
2492
+ if (headers .length == 0 ) {
2493
+ activeEditor .statusError (_ ("Specified folder/zip file does not contain a valid library" ));
2494
+ return ;
2495
+ }
2496
+
2486
2497
// copy folder
2487
2498
File destinationFolder = new File (BaseNoGui .getSketchbookLibrariesFolder (), sourceFile .getName ());
2488
2499
if (!destinationFolder .mkdir ()) {
@@ -2496,6 +2507,8 @@ public void handleAddLibrary() {
2496
2507
return ;
2497
2508
}
2498
2509
activeEditor .statusNotice (_ ("Library added to your libraries. Check \" Include library\" menu" ));
2510
+ } catch (IOException e ) {
2511
+ // FIXME error when importing. ignoring :(
2499
2512
} finally {
2500
2513
// delete zip created temp folder, if exists
2501
2514
FileUtils .recursiveDelete (tmpFolder );
You can’t perform that action at this time.
0 commit comments