mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-10-27 14:30:23 +00:00
create addon dir if it doesn't exist
This commit is contained in:
1 parent
e89d473669
commit
fa66bd3c42
1 file changed
+3
+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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user