提交 e9abc07c 编写于 作者: 魔术师Dix's avatar 魔术师Dix

【Fix】处理Unity的特有包,正确处理包安装;

上级 024d4bd5
......@@ -18,7 +18,7 @@ namespace UpmGitTool
/// </summary>
public static void SaveManifest()
{
var path= AppState.Path_ManifestFile;
var path = AppState.Path_ManifestFile;
var manifest = AppState.unityManifes;
manifest.SaveManifest(path);
}
......@@ -68,23 +68,41 @@ namespace UpmGitTool
public static void InstallVersion(this DependencyInfo depency)
{
string key = depency.name;
SemVersion depVer = SemVersion.Parse(depency.version);
var pkg = AppState.FindPackage(key);
var pkgVersion = pkg.Versions;
for (int i = 0; i < pkgVersion.Count; i++)
try
{
var tVersion = pkgVersion[i];
if (tVersion.Version >= depVer)
string key = depency.name;
if (depency.name.Contains("unity"))
{
InstallVersion(tVersion);
//Unity的包,直接安装;
AppState.unityManifes?.InstallVersion(key, depency.version);
return;
}
}
//没有目标版本,只有安装最新版本;
InstallVersion(pkgVersion[0]);
SemVersion depVer = SemVersion.Parse(depency.version);
var pkg = AppState.FindPackage(key);
var pkgVersion = pkg.Versions;
for (int i = 0; i < pkgVersion.Count; i++)
{
var tVersion = pkgVersion[i];
if (tVersion.Version >= depVer)
{
InstallVersion(tVersion);
return;
}
}
if (pkgVersion.Count > 0)
//没有目标版本,只有安装最新版本;
InstallVersion(pkgVersion[0]);
else
Logger.LogWarning($"{key} : 没有拉取到信息将不会安装");
}
catch (System.Exception ex)
{
Logger.LogError($"安装出错:{depency.name} | {depency.version}");
Logger.LogError(ex.StackTrace);
}
}
/// <summary>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册