Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: also checks if the user selected folder is readable #734

Merged
merged 2 commits into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion xcode/App-Mac/Functions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ func getSaveLocationURL() -> URL {
}

func setSaveLocationURL(url: URL) -> Bool {
guard FileManager.default.isReadableFile(atPath: url.path) else {
let alert = NSAlert()
alert.messageText = "Cannot read the specified path; please choose a different one."
alert.runModal()
return false
}
guard FileManager.default.isWritableFile(atPath: url.path) else {
let alert = NSAlert()
alert.messageText = "Can not write to path. Choose a different path."
alert.messageText = "Cannot write to the specified path; please choose a different one."
alert.runModal()
return false
}
Expand Down
Loading