fix: failed to duplicate version when no jar
This commit is contained in:
@@ -129,7 +129,9 @@ public class HMCLGameRepository extends DefaultGameRepository {
|
|||||||
|
|
||||||
if (dstDir.exists()) throw new IOException("Version exists");
|
if (dstDir.exists()) throw new IOException("Version exists");
|
||||||
FileUtils.copyDirectory(srcDir.toPath(), dstDir.toPath());
|
FileUtils.copyDirectory(srcDir.toPath(), dstDir.toPath());
|
||||||
|
if (Files.exists(dstDir.toPath().resolve(srcId + ".jar"))) {
|
||||||
Files.move(dstDir.toPath().resolve(srcId + ".jar"), dstDir.toPath().resolve(dstId + ".jar"));
|
Files.move(dstDir.toPath().resolve(srcId + ".jar"), dstDir.toPath().resolve(dstId + ".jar"));
|
||||||
|
}
|
||||||
Files.move(dstDir.toPath().resolve(srcId + ".json"), dstDir.toPath().resolve(dstId + ".json"));
|
Files.move(dstDir.toPath().resolve(srcId + ".json"), dstDir.toPath().resolve(dstId + ".json"));
|
||||||
VersionSetting oldVersionSetting = getVersionSetting(srcId).clone();
|
VersionSetting oldVersionSetting = getVersionSetting(srcId).clone();
|
||||||
GameDirectoryType originalGameDirType = oldVersionSetting.getGameDirType();
|
GameDirectoryType originalGameDirType = oldVersionSetting.getGameDirType();
|
||||||
|
|||||||
Reference in New Issue
Block a user