diff --git a/Executable/Sources/Commands/UpdateCommand.swift b/Executable/Sources/Commands/UpdateCommand.swift new file mode 100644 index 0000000..eaf869a --- /dev/null +++ b/Executable/Sources/Commands/UpdateCommand.swift @@ -0,0 +1,29 @@ +import ArgumentParser +import ColibriLibrary + +extension Colibri { + struct Update: AsyncParsableCommand { + + // MARK: Properties + + static let configuration = CommandConfiguration( + commandName: "update-dependencies", + abstract: "Update package dependencies in a Hummingbird app", + helpNames: .shortAndLong, + aliases: ["update"] + ) + + @OptionGroup var options: Options + + // MARK: Functions + + mutating func run() async throws { + let terminalService = TerminalService() + + let updateDependencies = UpdateDependenciesTask(terminalService: terminalService) + + try await updateDependencies(at: options.locationURL) + } + + } +} diff --git a/Executable/Sources/Options/UpdateOptions.swift b/Executable/Sources/Options/UpdateOptions.swift new file mode 100644 index 0000000..8dcb812 --- /dev/null +++ b/Executable/Sources/Options/UpdateOptions.swift @@ -0,0 +1,13 @@ +import ArgumentParser +import ColibriLibrary + +extension Colibri.Update { + struct Options: ParsableArguments, Locationable { + + // MARK: Properties + + @Option(name: .shortAndLong) + var location: String? + + } +}