Ensure file is moved

This commit is contained in:
modmuss50 2018-06-18 16:55:51 +01:00
parent cc23189335
commit 69f15e870c
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82

View file

@ -28,6 +28,7 @@ import net.fabricmc.loom.LoomGradleExtension;
import net.fabricmc.tinyremapper.OutputConsumerPath;
import net.fabricmc.tinyremapper.TinyRemapper;
import net.fabricmc.tinyremapper.TinyUtils;
import org.apache.commons.io.FileUtils;
import org.gradle.api.Project;
import java.io.File;
@ -53,8 +54,11 @@ public class ModRemapper {
deobfJar.delete();
}
FileUtils.touch(modJar); //Done to ensure that the file can be moved
//Move the pre existing mod jar to the deobf jar
modJar.renameTo(deobfJar);
if(!modJar.renameTo(deobfJar)){
throw new RuntimeException("Failed to rename " + modJar);
}
Path mappings = Constants.MAPPINGS_TINY.get(extension).toPath();