File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,11 @@ if (project.hasProperty("CustomReleaseVersion")) {
1717 version = project. property(" CustomReleaseVersion" ). replaceFirst(" ^release/" , " " )
1818} else {
1919 String gitRevision = " git rev-parse HEAD" . execute(). text. trim()
20+ if (gitRevision. isEmpty()) {
21+ gitRevision = ' unknown'
22+ }
2023
21- version = mod_version + ' +' + gitRevision. substring(0 , 10 )
24+ version = mod_version + ' +' + ( gitRevision. length() >= 10 ? gitRevision . substring(0 , 10 ) : gitRevision )
2225}
2326
2427tasks. register(" updateKelvin" ) {
Original file line number Diff line number Diff line change @@ -18,8 +18,11 @@ if (project.hasProperty("CustomReleaseVersion")) {
1818 version = project. property(" CustomReleaseVersion" ). replaceFirst(" ^release/" , " " )
1919} else {
2020 String gitRevision = " git rev-parse HEAD" . execute(). text. trim()
21+ if (gitRevision. isEmpty()) {
22+ gitRevision = ' unknown'
23+ }
2124
22- version = minecraft_version + ' -' + mod_version + ' -' + " fabric" + ' -' + gitRevision. substring(0 , 10 )
25+ version = minecraft_version + ' -' + mod_version + ' -' + " fabric" + ' -' + ( gitRevision. length() >= 10 ? gitRevision . substring(0 , 10 ) : gitRevision )
2326}
2427
2528configurations {
Original file line number Diff line number Diff line change @@ -22,8 +22,11 @@ if (project.hasProperty("CustomReleaseVersion")) {
2222 version = project. property(" CustomReleaseVersion" ). replaceFirst(" ^release/" , " " )
2323} else {
2424 String gitRevision = " git rev-parse HEAD" . execute(). text. trim()
25+ if (gitRevision. isEmpty()) {
26+ gitRevision = ' unknown'
27+ }
2528
26- version = minecraft_version + ' -' + mod_version + ' -' + " forge" + ' -' + gitRevision. substring(0 , 10 )
29+ version = minecraft_version + ' -' + mod_version + ' -' + " forge" + ' -' + ( gitRevision. length() >= 10 ? gitRevision . substring(0 , 10 ) : gitRevision )
2730}
2831
2932architectury {
You can’t perform that action at this time.
0 commit comments