create addon dir if it doesn't exist

This commit is contained in:
dfsek committed 2022-06-07 08:32:55 -07:00
1 parent e89d473669
commit fa66bd3c42
1 file changed
+3
@@ -80,7 +80,9 @@ public class BootstrapAddonLoader implements BootstrapBaseAddon<BootstrapBaseAdd
@Override @Override
public Iterable<BootstrapBaseAddon<?>> loadAddons(Path addonsFolder, BootstrapAddonClassLoader parent) { public Iterable<BootstrapBaseAddon<?>> loadAddons(Path addonsFolder, BootstrapAddonClassLoader parent) {
try {
Path bootstrapFolder = addonsFolder.resolve("bootstrap"); Path bootstrapFolder = addonsFolder.resolve("bootstrap");
Files.createDirectories(bootstrapFolder);
logger.debug("Loading bootstrap addons from {}", bootstrapFolder); logger.debug("Loading bootstrap addons from {}", bootstrapFolder);
try(Stream<Path> bootstrapAddons = Files.walk(bootstrapFolder, 1, FileVisitOption.FOLLOW_LINKS)) { try(Stream<Path> bootstrapAddons = Files.walk(bootstrapFolder, 1, FileVisitOption.FOLLOW_LINKS)) {
@@ -89,6 +91,7 @@ public class BootstrapAddonLoader implements BootstrapBaseAddon<BootstrapBaseAdd
.filter(path -> path.toString().endsWith(".jar")) .filter(path -> path.toString().endsWith(".jar"))
.map(path -> loadAddon(path, parent)) .map(path -> loadAddon(path, parent))
.collect(Collectors.toList()); .collect(Collectors.toList());
}
} catch(IOException e) { } catch(IOException e) {
throw new UncheckedIOException(e); throw new UncheckedIOException(e);
} }