Skip to content

Commit

Permalink
fix: Fix NoSuchFileExceptions if FCLI_HOME or FORTIFY_HOME set to rel…
Browse files Browse the repository at this point in the history
…ative directory (fixes #227)
  • Loading branch information
rsenden committed Jan 16, 2023
1 parent 5c81354 commit 851b274
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ public class FcliHomeHelper {
public static final Path getFortifyHomePath() {
String fortifyHome = System.getenv(ENVNAME_FORTIFY_HOME);
return StringUtils.isNotBlank(fortifyHome)
? Path.of(fortifyHome)
: Path.of(System.getProperty("user.home"), DEFAULT_FORTIFY_DIR_NAME);
? Path.of(fortifyHome).toAbsolutePath()
: Path.of(System.getProperty("user.home"), DEFAULT_FORTIFY_DIR_NAME).toAbsolutePath();
}

public static final Path getFcliHomePath() {
String fcliHome = System.getenv(ENVNAME_FCLI_HOME);
return StringUtils.isNotBlank(fcliHome)
? Path.of(fcliHome)
: getFortifyHomePath().resolve(DEFAULT_FCLI_DIR_NAME);
? Path.of(fcliHome).toAbsolutePath()
: getFortifyHomePath().resolve(DEFAULT_FCLI_DIR_NAME).toAbsolutePath();
}

public static final void saveSecuredFile(Path relativePath, Object contents, boolean failOnError) {
Expand Down

0 comments on commit 851b274

Please sign in to comment.