fix(app): make --capture failures visible in CI
Mirror the log to stderr in capture mode, report how many screenshots were written, exit non-zero when none were, and print the capture log in the CI step with a warning annotation when no images are produced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
This commit is contained in:
4 files changed
+48
-9
No files matched your search
@@ -24,7 +24,9 @@ public partial class App : Application
|
||||
base.OnStartup(e);
|
||||
Environment = AppEnvironment.Detect();
|
||||
_log = new FileLogSink(Environment.LogDirectory, "titano");
|
||||
Log.SetSink(_log);
|
||||
var capture = Array.IndexOf(e.Args, "--capture") >= 0;
|
||||
// Capture runs in CI: mirror the log to stderr so failures are visible in the job output.
|
||||
Log.SetSink(capture ? new TeeLogSink(_log, new StderrLogSink()) : _log);
|
||||
Log.Info("app", $"Titano {typeof(App).Assembly.GetName().Version} starting; data at {Environment.DataDirectory}");
|
||||
|
||||
Settings = AppSettings.Load(Environment.SettingsPath);
|
||||
@@ -45,7 +47,7 @@ public partial class App : Application
|
||||
MainWindow = window;
|
||||
|
||||
var captureIndex = Array.IndexOf(e.Args, "--capture");
|
||||
if (captureIndex >= 0)
|
||||
if (capture)
|
||||
{
|
||||
var dir = captureIndex + 1 < e.Args.Length ? e.Args[captureIndex + 1] : "screenshots";
|
||||
ScreenCapture.Run(window, shell, dir);
|
||||
|
||||
Reference in new issue
Block a user