Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.
TypeScript cross-platformelectronffmpegopen-sourceproduct-demorustscreen-capturescreen-recorderscreen-recordingscreen-studioscreencastspeech-to-texttypescriptvideo-editingvideo-editorwaylandwgpuwhisper
fix(diagnostic-tool): address CodeRabbit review
EtienneLescotea9bd62740ff
diff --git a/.github/workflows/diagnostic-artifact.yml b/.github/workflows/diagnostic-artifact.ymlindex 24a87c2ad..eb9279113 100644--- a/.github/workflows/diagnostic-artifact.yml+++ b/.github/workflows/diagnostic-artifact.yml@@ -43,14 +43,25 @@ jobs:- name: Smoke-test the bundleshell: pwsh+ # The actual capture path is exercised by users with a real desktop+ # session. A non-interactive runner has no display, so WGC cannot+ # capture frames and the helper exits before emitting [stop-timing].+ # Validate bundle structure + CLI parser instead of running capture.run: |$ErrorActionPreference = "Stop"Expand-Archive -Path openscreen-diagnostic-windows-x64.zip -DestinationPath smoke$smoke = Resolve-Path "smoke/openscreen-diagnostic-windows-x64"- & "$smoke/diagnostic.bat" --duration 3 --output "$smoke/smoke.json"- $report = Get-Content "$smoke/smoke.json" -Raw | ConvertFrom-Json- if ($report.exitCode -ne 0) { throw "Smoke test failed: exitCode=$($report.exitCode)" }- if ($report.stopTiming.Count -lt 1) { throw "Smoke test produced no [stop-timing] entries" }+ foreach ($rel in @(+ "diagnostic.mjs",+ "diagnostic.bat",+ "README.md",+ "helpers/win32-x64/wgc-capture.exe"+ )) {+ $p = Join-Path $smoke $rel+ if (-not (Test-Path $p)) { throw "Smoke test: missing $rel" }+ }+ & "$smoke/diagnostic.bat" --help | Out-Null+ if ($LASTEXITCODE -ne 0) { throw "diagnostic.bat --help exited $LASTEXITCODE" }- name: Upload Windows diagnostic bundleuses: actions/upload-artifact@v4diff --git a/scripts/diagnostic-tool/README.md b/scripts/diagnostic-tool/README.mdindex aa286210c..046468e3e 100644--- a/scripts/diagnostic-tool/README.md+++ b/scripts/diagnostic-tool/README.md@@ -20,7 +20,7 @@ Linux is not currently supported — OpenScreen has no Linux native helper.## Usage-```+```textnode diagnostic.mjs --duration 10 --output ./diag.json```@@ -49,7 +49,7 @@ stop cleanup is slow.## Layout-```+```textscripts/diagnostic-tool/README.mddiagnostic.mjs # the tooldiff --git a/scripts/diagnostic-tool/diagnostic.bat b/scripts/diagnostic-tool/diagnostic.batindex d709fe751..95c0f721d 100644--- a/scripts/diagnostic-tool/diagnostic.bat+++ b/scripts/diagnostic-tool/diagnostic.bat@@ -1,3 +1,3 @@-@echo off-setlocal+@echo off+setlocalnode "%~dp0diagnostic.mjs" %*\ No newline at end of filediff --git a/scripts/diagnostic-tool/diagnostic.mjs b/scripts/diagnostic-tool/diagnostic.mjsindex 77875ec5e..3b08d798c 100644--- a/scripts/diagnostic-tool/diagnostic.mjs+++ b/scripts/diagnostic-tool/diagnostic.mjs@@ -45,14 +45,27 @@ function parseArgs(argv) {source: "display",help: false,};+ const requireNumber = (raw, flag) => {+ const n = Number(raw);+ if (!Number.isFinite(n) || n <= 0) {+ throw new Error(`${flag} requires a positive number, got: ${raw}`);+ }+ return n;+ };for (let i = 0; i < argv.length; i += 1) {const arg = argv[i];if (arg === "--duration" || arg === "-d") {- opts.duration = Number(argv[++i]) * 1000;+ const value = argv[++i];+ if (value === undefined) throw new Error(`${arg} requires a value`);+ opts.duration = requireNumber(value, arg) * 1000;} else if (arg === "--output" || arg === "-o") {- opts.output = argv[++i];+ const value = argv[++i];+ if (value === undefined) throw new Error(`${arg} requires a value`);+ opts.output = value;} else if (arg === "--source") {- opts.source = argv[++i];+ const value = argv[++i];+ if (value === undefined) throw new Error(`${arg} requires a value`);+ opts.source = value;} else if (arg === "--window") {opts.source = "window";} else if (arg === "--help" || arg === "-h") {