Linux migration.

This commit is contained in:
2022-05-20 22:58:25 +02:00
parent 029e02fd2f
commit 14bbae67e5
16 changed files with 698 additions and 698 deletions

View File

@ -1,51 +1,51 @@
using System.IO;
using UnityEditor;
using UnityEngine;
namespace Utils
{
public class PackgeUpdater
{
private static string ManifestPath
{
get
{
var projectPath = Directory.GetParent(Application.dataPath).FullName;
var manifestPath = Path.Combine(projectPath, "Packages", "manifest.json");
return manifestPath;
}
}
public static string GetIdentifier(string input, char charFrom, char charTo)
{
var first = input.IndexOf(charFrom);
var second = input.IndexOf(charTo, first + 1);
var posFrom = input.IndexOf(charFrom, second + 1);
if (posFrom != -1) //if found char
{
var posTo = input.IndexOf(charTo, posFrom + 1);
if (posTo != -1) //if found char
{
return input.Substring(posFrom + 1, posTo - posFrom - 1);
}
}
return string.Empty;
}
[MenuItem("Assets/Update Git Packages", false, 1000)]
private static void UpdateGitPackages()
{
var lines = File.ReadAllLines(ManifestPath);
foreach (var line in lines)
{
if (line.Contains("git"))
{
var identifier = GetIdentifier(line, '"', '"');
Debug.Log("Checking for updates " + identifier);
UnityEditor.PackageManager.Client.Add(identifier);
}
}
}
}
}
using System.IO;
using UnityEditor;
using UnityEngine;
namespace Utils
{
public class PackgeUpdater
{
private static string ManifestPath
{
get
{
var projectPath = Directory.GetParent(Application.dataPath).FullName;
var manifestPath = Path.Combine(projectPath, "Packages", "manifest.json");
return manifestPath;
}
}
public static string GetIdentifier(string input, char charFrom, char charTo)
{
var first = input.IndexOf(charFrom);
var second = input.IndexOf(charTo, first + 1);
var posFrom = input.IndexOf(charFrom, second + 1);
if (posFrom != -1) //if found char
{
var posTo = input.IndexOf(charTo, posFrom + 1);
if (posTo != -1) //if found char
{
return input.Substring(posFrom + 1, posTo - posFrom - 1);
}
}
return string.Empty;
}
[MenuItem("Assets/Update Git Packages", false, 1000)]
private static void UpdateGitPackages()
{
var lines = File.ReadAllLines(ManifestPath);
foreach (var line in lines)
{
if (line.Contains("git"))
{
var identifier = GetIdentifier(line, '"', '"');
Debug.Log("Checking for updates " + identifier);
UnityEditor.PackageManager.Client.Add(identifier);
}
}
}
}
}