23 lines
803 B
Java
23 lines
803 B
Java
package io.gitlab.jfronny.glaunch.install.steps;
|
|
|
|
import io.gitlab.jfronny.glaunch.GLaunch;
|
|
import io.gitlab.jfronny.glaunch.install.SetupStepInfo;
|
|
import io.gitlab.jfronny.glaunch.install.Step;
|
|
import io.gitlab.jfronny.glaunch.model.InstanceMeta;
|
|
import io.gitlab.jfronny.glaunch.util.Utils;
|
|
|
|
import java.io.IOException;
|
|
import java.nio.file.Path;
|
|
|
|
public class WriteMetadataStep implements Step {
|
|
@Override
|
|
public void execute(SetupStepInfo info) throws IOException {
|
|
GLaunch.LOGGER.info("Writing metadata");
|
|
Path metaDir = GLaunch.INSTANCE_DIR.resolve(info.name()).resolve("instance.json");
|
|
InstanceMeta meta = new InstanceMeta();
|
|
meta.loaderType = info.loaderType();
|
|
meta.version = info.version().id;
|
|
Utils.writeObject(metaDir, meta);
|
|
}
|
|
}
|