Implemented the Update subcommand (#7)
This PR contains the work done to implement the `Update` subcommand that update the package dependencies in a *Hummingbird* project. Reviewed-on: #7 Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
This commit was merged in pull request #7.
This commit is contained in:
+6
-4
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
public struct OutdatedDependenciesTask {
|
||||
public struct UpdateDependenciesTask {
|
||||
|
||||
// MARK: Properties
|
||||
|
||||
@@ -14,7 +14,7 @@ public struct OutdatedDependenciesTask {
|
||||
|
||||
// MARK: Functions
|
||||
|
||||
public func callAsFunction(at location: URL? = nil) async throws (TerminalServiceError) {
|
||||
public func callAsFunction(at location: URL? = nil, checkOutdated: Bool = false) async throws (TerminalServiceError) {
|
||||
let executableURL = URL(at: "/usr/bin/swift")
|
||||
|
||||
var arguments: [String] = ["package", "update"]
|
||||
@@ -23,8 +23,10 @@ public struct OutdatedDependenciesTask {
|
||||
arguments.append(contentsOf: ["--package-path", location.pathString])
|
||||
}
|
||||
|
||||
arguments.append("--dry-run")
|
||||
|
||||
if checkOutdated {
|
||||
arguments.append("--dry-run")
|
||||
}
|
||||
|
||||
try await terminalService.run(executableURL, arguments: arguments)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user