namespace Sdt.Core;

internal static class ScriptLocator
{
    public static string? FindHelperScript(string projectRoot, string scriptFileName)
    {
        // Packaged location: alongside executable in ./scripts
        var bundled = Path.Combine(AppContext.BaseDirectory, "scripts", scriptFileName);
        if (File.Exists(bundled))
            return bundled;

        // Source/project location fallback
        var project = Path.Combine(projectRoot, "scripts", scriptFileName);
        if (File.Exists(project))
            return project;

        return null;
    }
}
