Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: read only system variables for properties #813

Merged
merged 2 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ static void setEnvOrPropertyIfExists(Consumer<String> setter, Map<String, Object
}

static void setEnvIfExists(Consumer<String> setter, String envKey) {
String param = getDotenv().get(envKey);
String param = System.getenv(envKey);
if (param != null) {
setter.accept(param);
}
Expand All @@ -245,7 +245,7 @@ static void setEnvIfExists(Consumer<String> setter, String envKey) {
private static Dotenv getDotenv() {
if (dotenv == null) {
try {
dotenv = Dotenv.configure().ignoreIfMissing().load();
dotenv = Dotenv.configure().ignoreIfMissing().ignoreIfMalformed().load();
} catch (IllegalStateException e) {
if (e.getMessage() != null && e.getMessage().contains("Duplicate key")) {
throw new ExitCodeExceptionMapper.ValidationException(RESOURCE_BUNDLE.getString("error.duplicate_environment_variable"), e);
Expand Down
2 changes: 1 addition & 1 deletion versions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ version.junit.jupiter=5.10.2

version.javax.activation..activation=1.1.1

version.io.github.cdimascio..dotenv-java=2.3.2
version.io.github.cdimascio..dotenv-java=3.0.0

version.info.picocli..picocli-codegen=4.7.6

Expand Down
Loading