Skip to content

Commit

Permalink
Use the secondary path for token storage only if it is writable and t…
Browse files Browse the repository at this point in the history
…here is no writable file on the primary path.
  • Loading branch information
azvegint committed Jun 28, 2024
1 parent 04dd233 commit ea7448d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ private static Path setupPath() {
return null;
}

Path primaryPath = Path.of(userHome, REL_NAME);
Path secondaryPath = Path.of(userHome, REL_NAME_SECONDARY);

// use secondary path only if it already exists and writable
Path path = Files.isWritable(secondaryPath)
Path path = Files.isWritable(secondaryPath) && !Files.isWritable(primaryPath)
? secondaryPath
: Path.of(userHome, REL_NAME);
: primaryPath;
Path workdir = path.getParent();

if (!Files.isWritable(path)) {
Expand Down

0 comments on commit ea7448d

Please sign in to comment.