From 956c1f5d2766cd0968858af9ec2fef2c196021eb Mon Sep 17 00:00:00 2001 From: Sven Weidauer Date: Sat, 8 Oct 2022 11:48:33 +0200 Subject: [PATCH] Make importer async --- Sources/MakeColors/Importers/Importer.swift | 2 +- Sources/MakeColors/MakeColors.swift | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/MakeColors/Importers/Importer.swift b/Sources/MakeColors/Importers/Importer.swift index 426fec8..5ba54c2 100644 --- a/Sources/MakeColors/Importers/Importer.swift +++ b/Sources/MakeColors/Importers/Importer.swift @@ -1,7 +1,7 @@ protocol Importer { init(source: String) throws - func read() throws -> [String: ColorDef] + func read() async throws -> [String: ColorDef] static var option: String { get } } diff --git a/Sources/MakeColors/MakeColors.swift b/Sources/MakeColors/MakeColors.swift index 3254d4e..c19563f 100644 --- a/Sources/MakeColors/MakeColors.swift +++ b/Sources/MakeColors/MakeColors.swift @@ -80,7 +80,7 @@ enum HelpTexts { } @main -public final class MakeColors: ParsableCommand, Context { +public final class MakeColors: AsyncParsableCommand, Context { @Argument(help: HelpTexts.input) var input: String @@ -101,9 +101,9 @@ public final class MakeColors: ParsableCommand, Context { public init() {} - public func run() throws { + public func run() async throws { let importer = try importer.type.init(source: input) - let data = try importer.read() + let data = try await importer.read() if dump { try dump(data: data)