fix: use proper dir in ModrinthImporter
This commit is contained in:
parent
cbba1ab70a
commit
7a7d009e29
|
@ -42,8 +42,8 @@ public class ModrinthImporter extends Importer<ModrinthModpackManifest> {
|
|||
protected void downloadMods(ModrinthModpackManifest manifest, Path instanceDir, ProcessState state) throws IOException {
|
||||
if (manifest.files() != null) {
|
||||
filesLoop: for (ModrinthModpackManifest.File file : manifest.files()) {
|
||||
Path path = instanceDir.getParent().resolve(file.path()).toAbsolutePath().normalize();
|
||||
if (!path.startsWith(instanceDir)) throw new IOException("Pack attempted to write file outside instance. This is unsupported!");
|
||||
Path path = instanceDir.resolve(file.path()).toAbsolutePath().normalize();
|
||||
if (!path.startsWith(instanceDir)) throw new IOException("Pack attempted to write file outside instance which is dangerous and thus unsupported: " + path);
|
||||
String sha1 = file.hashes().sha1();
|
||||
IOException failedDownload = new IOException("Could not download file");
|
||||
for (String url : file.downloads()) {
|
||||
|
|
Loading…
Reference in New Issue