1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-28 09:24:14 +01:00

Added empty library_index.json if default is not available.

This commit is contained in:
Cristian Maglie 2014-05-16 18:44:33 +02:00 committed by Federico Fissore
parent 98fec7222b
commit 12a2d872d6

View File

@ -620,6 +620,17 @@ public class BaseNoGui {
loadContributedHardware(indexer);
librariesIndexer = new LibrariesIndexer(BaseNoGui.getSettingsFolder());
File librariesIndexFile = librariesIndexer.getIndexFile();
if (!librariesIndexFile.isFile()) {
try {
// Otherwise create an empty packages index
FileOutputStream out = new FileOutputStream(librariesIndexFile);
out.write("{ \"libraries\" : [ ] }".getBytes());
out.close();
} catch (IOException e) {
e.printStackTrace();
}
}
librariesIndexer.parseIndex();
}