partial linux setup/install scripting

This commit is contained in:
theofficialgman
2026-08-25 22:48:00 -04:00
parent 48c4df342f
commit e3c4028b50
10 changed files with 851 additions and 0 deletions
@@ -0,0 +1,27 @@
namespace WiiCompiled.Setup.Linux;
/// <summary>
/// Finds the repo checkout this tool is running from by walking up from its own directory looking
/// for Launcher/local-build.sh - this tool operates directly on a git checkout (no bundled/staged
/// workspace copy), so there is no installed "Toolkit" layout to anchor on the way the Windows
/// installer's Installation.cs does.
/// </summary>
internal static class WorkspaceLocator
{
private const int MaxSearchDepth = 6;
public static string FindFrom(string startDirectory)
{
var current = new DirectoryInfo(startDirectory);
for (var level = 0; level <= MaxSearchDepth && current is not null; level++, current = current.Parent)
{
if (File.Exists(Path.Combine(current.FullName, "Launcher", "local-build.sh")))
{
return current.FullName;
}
}
throw new InvalidOperationException(
"Could not find the WiiCompiled repository (looked for Launcher/local-build.sh walking up " +
$"from {startDirectory}). Pass --workspace <path-to-checkout> explicitly.");
}
}