aboutsummaryrefslogtreecommitdiff
path: root/sharedVariables/src/SHVersionInfo.kt
diff options
context:
space:
mode:
Diffstat (limited to 'sharedVariables/src/SHVersionInfo.kt')
-rw-r--r--sharedVariables/src/SHVersionInfo.kt12
1 files changed, 12 insertions, 0 deletions
diff --git a/sharedVariables/src/SHVersionInfo.kt b/sharedVariables/src/SHVersionInfo.kt
new file mode 100644
index 000000000..2f948897e
--- /dev/null
+++ b/sharedVariables/src/SHVersionInfo.kt
@@ -0,0 +1,12 @@
+package at.skyhanni.sharedvariables
+
+object SHVersionInfo {
+ val gitHash by lazy {
+ val proc = ProcessBuilder("git", "rev-parse", "--short", "HEAD")
+ .redirectOutput(ProcessBuilder.Redirect.PIPE)
+ .redirectInput(ProcessBuilder.Redirect.PIPE)
+ .start()
+ proc.waitFor()
+ proc.inputStream.readBytes().decodeToString().trim()
+ }
+}