swiftformat changes

This commit is contained in:
Greg Neagle
2025-06-03 10:01:46 -07:00
parent b2ede3cdab
commit 842e5af453
2 changed files with 7 additions and 8 deletions

View File

@@ -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.")

View File

@@ -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()
}