2022-10-25 17:26:21 +08:00
|
|
|
|
namespace HybridCLR.Editor.Installer
|
|
|
|
|
{
|
|
|
|
|
public partial class InstallerController
|
|
|
|
|
{
|
|
|
|
|
public bool HasUpdateIl2Cpp(string il2cppBranch)
|
|
|
|
|
{
|
|
|
|
|
string workDir = SettingsUtil.HybridCLRDataDir;
|
|
|
|
|
// last hash hybridclr
|
|
|
|
|
{
|
2022-10-28 13:52:32 +08:00
|
|
|
|
string hybridclrRepoDir = $"{workDir}/{hybridclr_repo_path}";
|
2022-10-25 17:26:21 +08:00
|
|
|
|
var ret1 = BashUtil.RunCommand2(hybridclrRepoDir, "git",
|
|
|
|
|
new string[] { "log", "HEAD", "-n", "1", "--pretty=format:\"%H\"", });
|
2022-10-28 13:52:32 +08:00
|
|
|
|
BashUtil.RunCommand2(hybridclrRepoDir, "git",
|
|
|
|
|
new string[] { "fetch", "depth=1" });
|
2022-10-25 17:26:21 +08:00
|
|
|
|
var ret2 = BashUtil.RunCommand2(hybridclrRepoDir, "git",
|
|
|
|
|
new string[] { "log", "remotes/origin/HEAD", "-n", "1", "--pretty=format:\"%H\"", });
|
|
|
|
|
if (ret1.StdOut != ret2.StdOut)
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// last hash il2cpp_plus
|
|
|
|
|
{
|
2022-10-28 13:52:32 +08:00
|
|
|
|
string il2cppPlusRepoDir = $"{workDir}/{il2cpp_plus_repo_path}";
|
2022-10-25 17:26:21 +08:00
|
|
|
|
var ret1 = BashUtil.RunCommand2(il2cppPlusRepoDir, "git",
|
|
|
|
|
new string[] { "log", $"{il2cppBranch}", "-n", "1", "--pretty=format:\"%H\"", });
|
2022-10-28 13:52:32 +08:00
|
|
|
|
BashUtil.RunCommand2(il2cppPlusRepoDir, "git",
|
|
|
|
|
new string[] { "fetch", "depth=1" });
|
2022-10-25 17:26:21 +08:00
|
|
|
|
var ret2 = BashUtil.RunCommand2(il2cppPlusRepoDir, "git",
|
|
|
|
|
new string[] { "log", $"remotes/origin/{il2cppBranch}", "-n", "1", "--pretty=format:\"%H\"", });
|
|
|
|
|
if (ret1.StdOut != ret2.StdOut)
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|