feat(cli): print the wrapper version in info across all wrappers
This commit is contained in:
@@ -207,7 +207,10 @@ def _collect_diagnostics(quick: bool) -> dict:
|
||||
"""Gather environment + binary diagnostics without triggering a download."""
|
||||
diag: dict = {}
|
||||
|
||||
from ._version import __version__
|
||||
|
||||
diag["environment"] = {
|
||||
"wrapper": __version__,
|
||||
"python": sys.version.split()[0],
|
||||
"os": platform.system(),
|
||||
"arch": platform.machine(),
|
||||
@@ -297,6 +300,7 @@ def _print_diagnostics(diag: dict) -> None:
|
||||
"""Render the diagnostics dict as a human-readable report."""
|
||||
env = diag["environment"]
|
||||
print("CloakBrowser diagnostics")
|
||||
print(f"Wrapper: {env['wrapper']}")
|
||||
print(f"Python: {env['python']}")
|
||||
print(f"OS: {env['os']} {env['arch']}")
|
||||
print(f"Platform: {env.get('platform_tag', 'unknown')}")
|
||||
|
||||
@@ -97,6 +97,7 @@ static void PrintDiagnostics(Dictionary<string, object?> diag)
|
||||
{
|
||||
var env = (Dictionary<string, object?>)diag["environment"]!;
|
||||
Console.WriteLine("CloakBrowser diagnostics");
|
||||
Console.WriteLine($"Wrapper: {env["wrapper"]}");
|
||||
Console.WriteLine($".NET: {env["dotnet"]}");
|
||||
Console.WriteLine($"OS: {env["os"]} {env["arch"]}");
|
||||
Console.WriteLine($"Platform: {env.GetValueOrDefault("platform_tag") ?? "unknown"}");
|
||||
|
||||
@@ -16,6 +16,7 @@ internal static class Diagnostics
|
||||
|
||||
var env = new Dictionary<string, object?>
|
||||
{
|
||||
["wrapper"] = CloakVersion.Version,
|
||||
["dotnet"] = RuntimeInformation.FrameworkDescription,
|
||||
["os"] = RuntimeInformation.OSDescription,
|
||||
["arch"] = RuntimeInformation.OSArchitecture.ToString(),
|
||||
|
||||
@@ -22,6 +22,7 @@ import {
|
||||
normalizeRequestedVersion,
|
||||
versionNewer,
|
||||
CHROMIUM_VERSION,
|
||||
WRAPPER_VERSION,
|
||||
} from "./config.js";
|
||||
import { countFontsPresent, WINDOWS_FONT_TELLS, OFFICE_FONT_TELLS } from "./fonts.js";
|
||||
import { resolveLicenseKey, validateLicense, getProLatestRelease, getActiveSessionCount, type LicenseInfo } from "./license.js";
|
||||
@@ -201,6 +202,7 @@ export async function collectDiagnostics(quick: boolean): Promise<Record<string,
|
||||
const diag: Record<string, any> = {};
|
||||
|
||||
diag.environment = {
|
||||
wrapper: WRAPPER_VERSION,
|
||||
node: process.version,
|
||||
os: os.type(),
|
||||
arch: os.arch(),
|
||||
@@ -277,6 +279,7 @@ export async function collectDiagnostics(quick: boolean): Promise<Record<string,
|
||||
function printDiagnostics(diag: Record<string, any>): void {
|
||||
const env = diag.environment;
|
||||
console.log("CloakBrowser diagnostics");
|
||||
console.log(`Wrapper: ${env.wrapper}`);
|
||||
console.log(`Node: ${env.node}`);
|
||||
console.log(`OS: ${env.os} ${env.arch}`);
|
||||
console.log(`Platform: ${env.platform_tag ?? "unknown"}`);
|
||||
|
||||
Reference in New Issue
Block a user