Skip to content

Commit

Permalink
Revert "use ~/.speedrunigt on linux (RedLime#93)"
Browse files Browse the repository at this point in the history
This reverts commit c94fb87.
  • Loading branch information
tildejustin committed Jan 16, 2024
1 parent a31122b commit 2361e77
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 49 deletions.
19 changes: 1 addition & 18 deletions src/main/java/com/redlimerl/speedrunigt/SpeedRunIGT.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,19 @@
import com.redlimerl.speedrunigt.timer.category.RunCategory;
import com.redlimerl.speedrunigt.timer.category.condition.CategoryCondition;
import com.redlimerl.speedrunigt.timer.packet.TimerPackets;
import com.redlimerl.speedrunigt.utils.FilesHelper;
import com.redlimerl.speedrunigt.utils.FontIdentifier;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.ModContainer;
import net.fabricmc.loader.api.entrypoint.EntrypointContainer;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.Identifier;
import net.minecraft.util.Util;
import org.apache.commons.io.FileUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collection;
import java.util.HashMap;
Expand Down Expand Up @@ -55,22 +52,8 @@ public class SpeedRunIGT implements ModInitializer {
public static Path getMainPath() {
return FabricLoader.getInstance().getGameDir().resolve(MOD_ID);
}
public static Path getGlobalPath() { return new File(System.getProperty("user.home").replace("\\", "/"), SpeedRunIGT.MOD_ID).toPath(); }
public static Path getRecordsPath() { return getGlobalPath().resolve("records"); }
public static Path getGlobalPath() {
String home = System.getProperty("user.home").replace("\\", "/");
Path path = new File(home, SpeedRunIGT.MOD_ID).toPath();
Path linuxPath = new File(home, "." + SpeedRunIGT.MOD_ID).toPath();
if (Util.getOperatingSystem() == Util.OperatingSystem.LINUX) {
// used to use ~/speedrunigt instead of ~/.speedrunigt on linux
// if only the old directory exists we need to copy it over to the new one
if (Files.exists(path) && !Files.exists(linuxPath)) {
FilesHelper.recursiveCopy(path, linuxPath);
}
return linuxPath;
} else {
return path;
}
}

public static final Set<ModContainer> API_PROVIDERS = Sets.newHashSet();

Expand Down
31 changes: 0 additions & 31 deletions src/main/java/com/redlimerl/speedrunigt/utils/FilesHelper.java

This file was deleted.

0 comments on commit 2361e77

Please sign in to comment.