git commit number (UNFINISHED)

This commit is contained in:
Yoshman29
2023-03-23 12:51:27 +01:00
parent c2b64d7ec3
commit 18c107ab0a
2 changed files with 17 additions and 1 deletions
+1 -1
View File
@@ -1 +1 @@
2673
2674
+16
View File
@@ -0,0 +1,16 @@
package funkin.macros;
class GitCommitMacro {
public static macro function getCommitNumber() {
#if display
return macro $v{0};
#else
var proc = new Process('git', ['rev-list', 'HEAD', '--count'], false);
proc.exitCode(true);
var c = Std.parseInt(proc.stdout.readLine());
trace(c);
return macro $v{c};
#end
}
}