mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-03-13 17:46:58 +08:00
Renaming json as well as jar when the folder is renamed manually
This commit is contained in:
parent
d143ff48fa
commit
d53d56d93a
@ -232,6 +232,12 @@ public class DefaultGameRepository implements GameRepository {
|
||||
LOG.warning("Cannot rename json file, ignoring version " + id);
|
||||
return Stream.empty();
|
||||
}
|
||||
|
||||
File jar = new File(dir, FileUtils.getNameWithoutExtension(jsons.get(0)) + ".jar");
|
||||
if (jar.exists() && !jar.renameTo(new File(dir, id + ".jar"))) {
|
||||
LOG.warning("Cannot rename jar file, ignoring version " + id);
|
||||
return Stream.empty();
|
||||
}
|
||||
} else {
|
||||
LOG.info("No available json file found, ignoring version " + id);
|
||||
return Stream.empty();
|
||||
|
Loading…
x
Reference in New Issue
Block a user