Skip to content

Commit

Permalink
Fix error with Swift 5.6 arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Nef10 committed Apr 18, 2022
1 parent ef3df44 commit bca7b75
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ enum PackageDescriptionFactory {

private static func readPackageDescription(from folder: URL) throws -> String {
do {
let output = try shellOut(to: "swift", arguments: ["package", "dump-package", "--package-path", "\"\(folder.path)\"" ])
let output = try shellOut(to: "swift", arguments: ["package", "--package-path", "\"\(folder.path)\"", "dump-package" ])
return output
} catch {
let error = error as! ShellOutError // swiftlint:disable:this force_cast
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ struct ResolvedPackage: Decodable {

static func resolveAndLoadResolvedPackage(from folder: URL) throws -> ResolvedPackage {
do {
try shellOut(to: "swift", arguments: ["package", "resolve", "--package-path", "\"\(folder.path)\"" ])
try shellOut(to: "swift", arguments: ["package", "--package-path", "\"\(folder.path)\"", "resolve" ])
} catch {
let error = error as! ShellOutError // swiftlint:disable:this force_cast
throw ResolvedPackageError.resolvingFailed(error.message)
Expand Down
6 changes: 3 additions & 3 deletions Sources/SwiftDependencyUpdaterLibrary/Update.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ enum Update: Equatable {
let packageUpdate = try swiftPackage.performUpdate(self, of: dependency)
print("Updated Package.swift".green)
if packageUpdate {
try shellOut(to: "swift", arguments: ["package", "update", dependency.name, "--package-path", "\"\(folder.path)\"" ])
try shellOut(to: "swift", arguments: ["package", "--package-path", "\"\(folder.path)\"", "update", dependency.name ])
print("Resolved to new version".green)
} else {
try shellOut(to: "swift", arguments: ["package", "update", "resolve", "--package-path", "\"\(folder.path)\"" ])
try shellOut(to: "swift", arguments: ["package", "--package-path", "\"\(folder.path)\"", "update", "resolve", ])
print("Resolved Version".green)
}
case let .withoutChangingRequirements(version):
print("Updating \(dependency.name): \(dependency.resolvedVersion.versionNumberOrRevision) -> \(version)".bold)
try shellOut(to: "swift", arguments: ["package", "update", dependency.name, "--package-path", "\"\(folder.path)\"" ])
try shellOut(to: "swift", arguments: ["package", "--package-path", "\"\(folder.path)\"", "update", dependency.name, ])
print("Resolved to new version".green)
default:
// Do nothing
Expand Down

0 comments on commit bca7b75

Please sign in to comment.