Skip to content

Commit 12a2d87

Browse files
cmaglieFederico Fissore
authored and
Federico Fissore
committed
Added empty library_index.json if default is not available.
1 parent 98fec72 commit 12a2d87

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: arduino-core/src/processing/app/BaseNoGui.java

+11
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,17 @@ static public void initPackages() throws Exception {
620620
loadContributedHardware(indexer);
621621

622622
librariesIndexer = new LibrariesIndexer(BaseNoGui.getSettingsFolder());
623+
File librariesIndexFile = librariesIndexer.getIndexFile();
624+
if (!librariesIndexFile.isFile()) {
625+
try {
626+
// Otherwise create an empty packages index
627+
FileOutputStream out = new FileOutputStream(librariesIndexFile);
628+
out.write("{ \"libraries\" : [ ] }".getBytes());
629+
out.close();
630+
} catch (IOException e) {
631+
e.printStackTrace();
632+
}
633+
}
623634
librariesIndexer.parseIndex();
624635
}
625636

0 commit comments

Comments
 (0)