Generate tag overview, add file action

This commit is contained in:
Christoph Hagen
2025-01-05 09:21:21 +01:00
parent 0dca633805
commit 01baf560ee
27 changed files with 501 additions and 137 deletions

View File

@ -1,4 +1,5 @@
import Foundation
import AppKit
struct SecurityBookmark {
@ -28,6 +29,14 @@ struct SecurityBookmark {
// MARK: Write
func openFinderWindow(relativePath: String) {
with(relativePath: relativePath) { path in
print("Opening file at \(path)")
NSWorkspace.shared.activateFileViewerSelecting([path])
return
}
}
func fullPath(to relativePath: String) -> URL {
url.appending(path: relativePath, directoryHint: .notDirectory)
}
@ -103,6 +112,10 @@ struct SecurityBookmark {
// MARK: Read
func size(of relativePath: String) -> Int? {
with(relativePath: relativePath) { $0.size }
}
func hasFile(at relativePath: String) -> Bool {
with(relativePath: relativePath, perform: exists)
}
@ -212,6 +225,7 @@ struct SecurityBookmark {
func deleteFile(at relativePath: String) -> Bool {
with(relativePath: relativePath) { file in
guard exists(file) else {
print("Scope: No file to delete at \(file.path())")
return true
}
do {