mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-13 22:04:36 +01:00
Format commit timestamp in local time
This commit is contained in:
@@ -180,7 +180,7 @@ tasks.register('injectGitHash') {
|
||||
|
||||
def gitCommitTime = {
|
||||
try {
|
||||
return 'git log -1 --format=%cd --date=iso'.execute().text.trim()
|
||||
return 'git log -1 --format=%at --date=unix'.execute().text.trim()
|
||||
} catch (ignored) {
|
||||
return ''
|
||||
}
|
||||
@@ -192,7 +192,7 @@ package emu.lunarcore;
|
||||
public final class BuildConfig {
|
||||
public static final String VERSION = \"${version}\";
|
||||
public static final String GIT_HASH = \"${gitCommitHash()}\";
|
||||
public static final String GIT_HASH_TIME = \"${gitCommitTime()}\";
|
||||
public static final long COMMIT_TIMESTAMP = ${gitCommitTime()};
|
||||
}
|
||||
"""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user