24 lines
631 B
C#
24 lines
631 B
C#
using UnityEngine;
|
|
using UnityEditor;
|
|
using System.IO;
|
|
|
|
namespace GameEditor.Util
|
|
{
|
|
|
|
public static class GitUtil
|
|
{
|
|
|
|
//
|
|
public static string GetCurBenchName()
|
|
{
|
|
string dir = Application.dataPath.Replace("/Assets", "");
|
|
string fileName = dir + "/BenchName.txt";
|
|
ProcessUtil.ProcessCommand(dir, "git symbolic-ref --short -q HEAD>" + fileName);
|
|
string[] flines = File.ReadAllLines(fileName, System.Text.Encoding.UTF8);
|
|
string benchName = flines[0].Trim();
|
|
File.Delete(fileName);
|
|
return benchName;
|
|
}
|
|
|
|
}
|
|
} |