mirror of
https://github.com/munki/munki.git
synced 2026-01-06 06:29:56 -06:00
swiftformat changes
This commit is contained in:
@@ -82,26 +82,25 @@ extension ManifestUtil {
|
||||
struct ListCatalogItems: AsyncParsableCommand {
|
||||
static var configuration = CommandConfiguration(
|
||||
abstract: "Lists items in the given catalogs.")
|
||||
|
||||
|
||||
@Argument(help: ArgumentHelp(
|
||||
"Catalog name",
|
||||
valueName: "catalog-name"
|
||||
))
|
||||
var catalogNames: [String] = []
|
||||
|
||||
|
||||
func validate() throws {
|
||||
if catalogNames.isEmpty {
|
||||
throw ValidationError("At least one catalog name must be provided.")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func run() async throws {
|
||||
guard let repo = RepoConnection.shared.repo else { return }
|
||||
guard let availableCatalogs = await getCatalogNames(repo: repo) else
|
||||
{
|
||||
guard let availableCatalogs = await getCatalogNames(repo: repo) else {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
for catalogName in catalogNames {
|
||||
if !availableCatalogs.contains(catalogName) {
|
||||
printStderr("Catalog '\(catalogName)' does not exist.")
|
||||
|
||||
@@ -44,9 +44,9 @@ func connectToRepo() throws -> Repo {
|
||||
/// A singleton class for our repo connection
|
||||
class RepoConnection {
|
||||
static var shared = RepoConnection()
|
||||
|
||||
|
||||
var repo: Repo?
|
||||
|
||||
|
||||
private init() {
|
||||
repo = try? connectToRepo()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user