Skip to content

Commit

Permalink
Check version file
Browse files Browse the repository at this point in the history
  • Loading branch information
dellis1972 committed Oct 12, 2024
1 parent 7900e70 commit 8f1036e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions MonoGame.Framework.Content.Pipeline/ExternalTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,12 @@ public static void RestoreDotnetTools()
path= Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "linux");
if (CurrentPlatform.OS == OS.MacOSX)
path= Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "osx");
if (File.Exists(Path.Combine(path, $"tools_{version}.txt")))
var versionFile = Path.Combine(path, $"tools_version.txt");
if (File.Exists(versionFile) && File.ReadAllText (versionFile) == version)
return;
RestoreDotnetTool("install", Crunch, CrunchVersion, path);
RestoreDotnetTool("install", BasisU, BasisUVersion, path);
File.WriteAllText(Path.Combine(path, $"tools_{version}.txt"), version);
File.WriteAllText(versionFile, version);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,8 @@ private void RestoreMGCB()
var appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
var version = Assembly.GetExecutingAssembly().GetName().Version.ToString();
var workingDirectory = Path.Combine(appDataPath, "mgcb-dotnet-tool", version);
if (Directory.Exists(workingDirectory))
return;
Directory.CreateDirectory(workingDirectory);
var dotnet = Global.Unix ? "dotnet" : "dotnet.exe";
if (Util.Run(dotnet, $"tool install dotnet-mgcb --version {version} --tool-path .", workingDirectory) != 0)
Expand Down

0 comments on commit 8f1036e

Please sign in to comment.