Skip to content

Commit 582822a

Browse files
committed
Use ~/Library/Application Support/DevAuth for the config dir on macOS
1 parent e27fd7d commit 582822a

File tree

1 file changed

+4
-1
lines changed
  • common/src/main/java/me/djtheredstoner/devauth/common/util

1 file changed

+4
-1
lines changed

common/src/main/java/me/djtheredstoner/devauth/common/util/Util.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ public class Util {
2424

2525
public static File getDefaultConfigDir() {
2626
String osName = System.getProperty("os.name");
27-
if (osName.startsWith("Linux") || osName.startsWith("FreeBSD") || osName.startsWith("SunOS") || osName.startsWith("Unix")) {
27+
if (osName.startsWith("Mac")) {
28+
String applicationSupport = System.getProperty("user.home") + File.separator + "Library" + File.separator + "Application Support";
29+
return new File(applicationSupport, "DevAuth");
30+
} else if (osName.startsWith("Linux") || osName.startsWith("FreeBSD") || osName.startsWith("SunOS") || osName.startsWith("Unix")) {
2831
String xdgConfigHome = System.getenv("XDG_CONFIG_HOME");
2932
if (xdgConfigHome == null) xdgConfigHome = System.getProperty("user.home") + File.separator + ".config";
3033
return new File(xdgConfigHome, "devauth");

0 commit comments

Comments
 (0)