aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/polyfrost/oneconfig/config/profiles
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io/polyfrost/oneconfig/config/profiles')
-rw-r--r--src/main/java/io/polyfrost/oneconfig/config/profiles/Profiles.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/main/java/io/polyfrost/oneconfig/config/profiles/Profiles.java b/src/main/java/io/polyfrost/oneconfig/config/profiles/Profiles.java
index db9fce2..45d448d 100644
--- a/src/main/java/io/polyfrost/oneconfig/config/profiles/Profiles.java
+++ b/src/main/java/io/polyfrost/oneconfig/config/profiles/Profiles.java
@@ -11,8 +11,8 @@ import java.util.ArrayList;
import java.util.Arrays;
public class Profiles {
- public static ArrayList<String> profiles;
private static final File profileDir = new File("OneConfig/profiles");
+ public static ArrayList<String> profiles;
public static String getCurrentProfile() {
if (!profileDir.exists() && !profileDir.mkdir()) {
@@ -21,8 +21,7 @@ public class Profiles {
}
if (profiles == null) {
String[] profilesArray = new File("OneConfig/profiles").list((file, s) -> file.isDirectory());
- if (profilesArray != null)
- profiles = new ArrayList<>(Arrays.asList(profilesArray));
+ if (profilesArray != null) profiles = new ArrayList<>(Arrays.asList(profilesArray));
}
if (!getProfileDir(OneConfigConfig.currentProfile).exists()) {
createProfile(OneConfigConfig.currentProfile);
@@ -62,8 +61,7 @@ public class Profiles {
try {
File newFile = new File(new File("OneConfig/profiles"), newName);
FileUtils.moveDirectory(getProfileDir(name), newFile);
- if (OneConfigConfig.currentProfile.equals(name))
- OneConfigConfig.currentProfile = newName;
+ if (OneConfigConfig.currentProfile.equals(name)) OneConfigConfig.currentProfile = newName;
profiles.remove(name);
profiles.add(newName);
} catch (IOException e) {