mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-08-30 13:50:46 +00:00
c445a0434d
Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
22 lines
519 B
Kotlin
22 lines
519 B
Kotlin
package com.dfsek.terra
|
|
|
|
import java.io.ByteArrayOutputStream
|
|
import org.gradle.api.Project
|
|
|
|
fun Project.getGitHash(): String {
|
|
val stdout = ByteArrayOutputStream()
|
|
exec {
|
|
commandLine = mutableListOf("git", "rev-parse", "--short", "HEAD")
|
|
standardOutput = stdout
|
|
}
|
|
return stdout.toString().trim()
|
|
}
|
|
|
|
fun Project.gitClone(name: String) {
|
|
val stdout = ByteArrayOutputStream()
|
|
exec {
|
|
commandLine = mutableListOf("git", "clone", name)
|
|
standardOutput = stdout
|
|
}
|
|
}
|