Commit 7e98a2ca20
7e98a2ca205eea3866d838a6b794b9a2e5627cfd
parent: 0adc91d2a0
Verified · cmc
cmc <hello@cleberg.net> · 2026-11-26 22:08 UTC
Snapshot runs don't read the clock title key from the Keychain
Changed files (2)
Sources/Orgstar/DevelopmentHooks.swift
+3 · view
| @@ -18,12 +18,15 @@ import OrgEditorAppKit |
| 18 | 18 | /// - `ORGSTAR_SNAPSHOT`: after `ORGSTAR_SNAPSHOT_DELAY` seconds (default 3), render the main |
| 19 | 19 | /// window to this PNG path and quit. Rendering from inside the app needs no screen-recording |
| 20 | 20 | /// permission. |
| 21 | /// The clock title key isn't read from the Keychain in such a run. |
| 21 | 22 | enum DevelopmentHooks { |
| 22 | 23 | static var fileToOpen: String? { ProcessInfo.processInfo.environment["ORGSTAR_OPEN"] } |
| 23 | 24 | static var rootToAdd: String? { ProcessInfo.processInfo.environment["ORGSTAR_ROOT"] } |
| 24 | 25 | static var windowToOpen: String? { ProcessInfo.processInfo.environment["ORGSTAR_WINDOW"] } |
| 25 | 26 | static var commandToRun: String? { ProcessInfo.processInfo.environment["ORGSTAR_COMMAND"] } |
| 26 | 27 | static var urlToOpen: String? { ProcessInfo.processInfo.environment["ORGSTAR_URL"] } |
| 28 | /// `ORGSTAR_SNAPSHOT` is set: the run renders a window and quits. |
| 29 | static var snapshotting: Bool { ProcessInfo.processInfo.environment["ORGSTAR_SNAPSHOT"] != nil } |
| 27 | 30 | static var answers: [String] { ProcessInfo.processInfo.environment["ORGSTAR_ANSWERS"]?.split(separator: ",").map(String.init) ?? [] } |
| 28 | 31 | |
| 29 | 32 | @MainActor |
Sources/Orgstar/OrgstarApp.swift
+5 · view
| @@ -497,7 +497,12 @@ struct OrgstarApp: App { |
| 497 | 497 | @State private var clock = ClockModel() |
| 498 | 498 | @State private var scheduler = SystemReminderCenter.isAvailable ? ReminderScheduler(center: SystemReminderCenter()) : nil |
| 499 | 499 | @State private var session: DocumentSession = { |
| 500 | #if APPSTORE |
| 500 | 501 | ClockTask.titleKey = ClockTitleKey.loadOrCreate() |
| 502 | #else |
| 503 | // A snapshot run is a renamed, ad hoc signed copy, which the Keychain would stop at a prompt. |
| 504 | ClockTask.titleKey = DevelopmentHooks.snapshotting ? nil : ClockTitleKey.loadOrCreate() |
| 505 | #endif |
| 501 | 506 | let session = DocumentSession() |
| 502 | 507 | session.defaults = Preferences.orgSettings |
| 503 | 508 | // Before any window: capture and agenda edits can save before the main window opens. |