Skip to content

Commit b522a68

Browse files
committed
Add git rev helper
1 parent a5eb9e6 commit b522a68

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • src/main/java/cam72cam/universalmodcore

src/main/java/cam72cam/universalmodcore/Util.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@
88
import java.io.IOException;
99

1010
public class Util {
11+
public static String GitRevision() throws IOException, GitAPIException {
12+
return Git.open(new File(System.getProperty("user.dir"))).log().setMaxCount(1).call().iterator().next().abbreviate(6).name();
13+
}
14+
1115
public static void GitClone(String repository, String branch, String path) throws IOException, GitAPIException {
1216
File clonePath = new File(System.getProperty("user.dir"), path);
17+
18+
19+
1320
String useSSH = System.getProperty("ssh.http");
1421
if (useSSH != null) {
1522
useSSH = useSSH.toLowerCase();

0 commit comments

Comments
 (0)