Trigger folder access prompts in permission checks; add lead welcome

This commit is contained in:
Ian Gulliver
2026-10-22 08:01:59 -07:00
parent e1eeaad925
commit a3d1852f45
13 changed files with 227 additions and 149 deletions
+18 -1
View File
@@ -56,9 +56,26 @@ func checkOrion() -> [String: String] {
}
}
func checkFolder(_ name: String, _ path: String) -> [String: String] {
let dir = (NSHomeDirectory() as NSString).appendingPathComponent(path)
if !FileManager.default.fileExists(atPath: dir) {
return permission(name, "unchecked", "\(dir) doesn't exist.", "FilesAndFolders")
}
do {
let entries = try FileManager.default.contentsOfDirectory(atPath: dir)
return permission(name, "granted", "Listed \(dir) (entries: \(entries.count)).", "FilesAndFolders")
} catch {
return permission(name, "missing", "Listing \(dir) failed (\(error.localizedDescription)). Switch \(name) on under byre in Files & Folders.", "FilesAndFolders")
}
}
func runCheck() {
Task.detached {
let rows = [await checkScreenRecording(), checkAccessibility(), checkOrion()]
let rows = [
await checkScreenRecording(), checkAccessibility(), checkOrion(),
checkFolder("Desktop Folder", "Desktop"), checkFolder("Documents Folder", "Documents"),
checkFolder("Downloads Folder", "Downloads"), checkFolder("iCloud Drive", "Library/Mobile Documents/com~apple~CloudDocs"),
]
let out = try! JSONSerialization.data(withJSONObject: rows, options: .withoutEscapingSlashes)
FileHandle.standardOutput.write(out + Data("\n".utf8))
exit(0)