Skip to content

Commit d92b4e7

Browse files
committed
fix: prefer cli options over environment variables
1 parent a56081b commit d92b4e7

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 6.1.1
44
##### Fixes
55
- do not consider project properties for command options anymore
6+
- prefer cli options e.g. `-Dgit.ref=...` over environment variables e.g. `VERSIONING_GIT_REF=...`)
67

78
## 6.1.0
89
##### Features

src/main/java/me/qoomon/gradle/gitversioning/GitVersioningPluginExtension.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ private void normalizeConfig(GitVersioningPluginConfig config) {
613613
}
614614

615615
private String getCommandOption(final String name) {
616-
String value = null;
616+
String value = System.getProperty(name);
617617
if (value == null) {
618618
String plainName = name.replaceFirst("^versioning\\.", "");
619619
String environmentVariableName = "VERSIONING_"
@@ -622,9 +622,6 @@ private String getCommandOption(final String name) {
622622
.toUpperCase();
623623
value = System.getenv(environmentVariableName);
624624
}
625-
if (value == null) {
626-
value = System.getProperty(name);
627-
}
628625
return value;
629626
}
630627

0 commit comments

Comments
 (0)