docs: add Reminders prompt workaround
This commit is contained in:
parent
0c1b48dad2
commit
bc92d10262
@ -76,3 +76,10 @@ Date-only due inputs create all-day reminders; date-time inputs create timed rem
|
||||
Run `remindctl authorize` to trigger the system prompt. If access is denied, enable
|
||||
Terminal (or remindctl) in System Settings → Privacy & Security → Reminders.
|
||||
If running over SSH, grant access on the Mac that runs the command.
|
||||
If no prompt appears in your terminal app, run:
|
||||
|
||||
```bash
|
||||
osascript -e 'tell application "Reminders" to get name of reminders'
|
||||
```
|
||||
|
||||
Then allow access and rerun `remindctl status`.
|
||||
|
||||
@ -18,6 +18,8 @@ public enum RemindCoreError: LocalizedError, Sendable, Equatable {
|
||||
"Reminders access denied.",
|
||||
"Run `remindctl authorize` to trigger the prompt, then allow Terminal (or remindctl)",
|
||||
"in System Settings > Privacy & Security > Reminders.",
|
||||
"If no prompt appears, run `osascript -e 'tell application \"Reminders\" to get name of reminders'`",
|
||||
"once from the same terminal app.",
|
||||
"If running over SSH, grant access on the Mac that runs the command.",
|
||||
].joined(separator: " ")
|
||||
case .writeOnlyAccess:
|
||||
|
||||
@ -2,6 +2,7 @@ import RemindCore
|
||||
|
||||
enum PermissionsHelp {
|
||||
static let settingsPath = "System Settings > Privacy & Security > Reminders"
|
||||
static let promptWorkaround = #"osascript -e 'tell application "Reminders" to get name of reminders'"#
|
||||
|
||||
static func guidanceLines(for status: RemindersAuthorizationStatus) -> [String] {
|
||||
switch status {
|
||||
@ -15,6 +16,7 @@ enum PermissionsHelp {
|
||||
case .denied, .restricted:
|
||||
return [
|
||||
"Grant access in \(settingsPath) for Terminal (or remindctl).",
|
||||
"If no prompt appears, run `\(promptWorkaround)` once from the same terminal app.",
|
||||
"If running over SSH, grant access on the Mac that runs the command.",
|
||||
]
|
||||
case .writeOnly:
|
||||
|
||||
14
Tests/remindctlTests/PermissionsHelpTests.swift
Normal file
14
Tests/remindctlTests/PermissionsHelpTests.swift
Normal file
@ -0,0 +1,14 @@
|
||||
import Testing
|
||||
|
||||
@testable import RemindCore
|
||||
@testable import remindctl
|
||||
|
||||
@MainActor
|
||||
struct PermissionsHelpTests {
|
||||
@Test("Denied guidance includes terminal prompt workaround")
|
||||
func deniedGuidanceIncludesPromptWorkaround() {
|
||||
let guidance = PermissionsHelp.guidanceLines(for: .denied).joined(separator: "\n")
|
||||
#expect(guidance.contains("osascript"))
|
||||
#expect(guidance.contains("Reminders"))
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user