mirror of
https://github.com/Melledy/LunarCore.git
synced 2026-02-04 15:05:07 +01:00
Fix compile issue with commit timestamp
This commit is contained in:
@@ -180,9 +180,9 @@ tasks.register('injectGitHash') {
|
|||||||
|
|
||||||
def gitCommitTime = {
|
def gitCommitTime = {
|
||||||
try {
|
try {
|
||||||
return 'git log -1 --format=%at --date=unix'.execute().text.trim()
|
return 'git log -1 --format=%at --date=raw'.execute().text.trim()
|
||||||
} catch (ignored) {
|
} catch (ignored) {
|
||||||
return ''
|
return '0'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -229,7 +229,9 @@ public class LunarCore {
|
|||||||
builder.append(hash);
|
builder.append(hash);
|
||||||
|
|
||||||
long timestamp = buildConfig.getField("COMMIT_TIMESTAMP").getLong(null);
|
long timestamp = buildConfig.getField("COMMIT_TIMESTAMP").getLong(null);
|
||||||
builder.append(" (" + sf.format(new Date(timestamp * 1000)) + ")");
|
if (timestamp > 0) {
|
||||||
|
builder.append(" (" + sf.format(new Date(timestamp * 1000)) + ")");
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// Ignored
|
// Ignored
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user