Skip to content

Commit

Permalink
find a writable directory when we're a snap
Browse files Browse the repository at this point in the history
  • Loading branch information
eyedeekay committed Jun 27, 2024
1 parent 045c6db commit 1e4d327
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion java/net/i2p/router/WindowsAppUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ protected File appImageConfig() {
File winConfigDir = new File(aih, "config");
if (winConfigDir != null) {
if (winConfigDir.exists()) {

return winConfigDir;
}
}
Expand All @@ -131,6 +130,14 @@ protected File appImageConfig() {
File linConfigDir = new File(aih, "lib/config");
if (linConfigDir != null) {
if (linConfigDir.exists()) {
File cfg = new File(linConfigDir, "router.config");
if (cfg.canWrite())
return linConfigDir;
else {
String home = System.getenv("HOME");
if (home != null)
linConfigDir = new File(home,"config");
}
return linConfigDir;
}
}
Expand Down

0 comments on commit 1e4d327

Please sign in to comment.