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() {
24832483 return ;
24842484 }
24852485
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+
24862497 // copy folder
24872498 File destinationFolder = new File (BaseNoGui .getSketchbookLibrariesFolder (), sourceFile .getName ());
24882499 if (!destinationFolder .mkdir ()) {
@@ -2496,6 +2507,8 @@ public void handleAddLibrary() {
24962507 return ;
24972508 }
24982509 activeEditor .statusNotice (_ ("Library added to your libraries. Check \" Include library\" menu" ));
2510+ } catch (IOException e ) {
2511+ // FIXME error when importing. ignoring :(
24992512 } finally {
25002513 // delete zip created temp folder, if exists
25012514 FileUtils .recursiveDelete (tmpFolder );
You can’t perform that action at this time.
0 commit comments