Generate tag overview, add file action
This commit is contained in:
@ -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 {
|
||||
|
Reference in New Issue
Block a user