mirror of
https://github.com/munki/munki.git
synced 2026-01-26 00:49:21 -06:00
New Repo method optionally return the filesystem path to an item.
This commit is contained in:
11
code/cli/munki/iconimporter/iconimporter.swift
Normal file
11
code/cli/munki/iconimporter/iconimporter.swift
Normal file
@@ -0,0 +1,11 @@
|
||||
//
|
||||
// main.swift
|
||||
// iconimporter
|
||||
//
|
||||
// Created by Greg Neagle on 9/13/24.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
print("Hello, World!")
|
||||
|
||||
@@ -30,6 +30,7 @@ protocol Repo {
|
||||
func put(_ identifier: String, content: Data) throws
|
||||
func put(_ identifier: String, fromFile local_file_path: String) throws
|
||||
func delete(_ identifier: String) throws
|
||||
func pathFor(_ identifier: String) -> String?
|
||||
}
|
||||
|
||||
// MARK: share mounting functions
|
||||
@@ -286,4 +287,10 @@ class FileRepo: Repo {
|
||||
func delete(_ identifier: String) throws {
|
||||
try FileManager.default.removeItem(atPath: fullPath(identifier))
|
||||
}
|
||||
|
||||
/// Returns the filesystem path to the item in the repo
|
||||
/// Non-filesystem Repo sublcasses should implement this but return nil
|
||||
func pathFor(_ identifier: String) -> String? {
|
||||
return fullPath(identifier)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user