Update the tools to use swift-command-line-tools.

This commit is contained in:
Doug
2024-05-15 10:37:44 +01:00
committed by Doug
parent 5fe84f9c85
commit 8da1752493
11 changed files with 49 additions and 64 deletions
+4 -3
View File
@@ -1,10 +1,11 @@
import ArgumentParser
import CommandLineTools
import Foundation
struct OutdatedPackages: ParsableCommand {
static var configuration = CommandConfiguration(abstract: "A tool to check outdated package dependencies. Please make sure you have already run setup-project before using this tool.")
private var projectSwiftPMDirectoryURL: URL { Utilities.projectDirectoryURL.appendingPathComponent("ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm") }
private var projectSwiftPMDirectoryURL: URL { .projectDirectory.appendingPathComponent("ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm") }
func run() throws {
try checkToolsDependencies()
@@ -12,12 +13,12 @@ struct OutdatedPackages: ParsableCommand {
}
func checkToolsDependencies() throws {
guard let output = try Utilities.zsh("swift outdated"), !output.isEmpty else { return }
guard let output = try Zsh.run(command: "swift outdated"), !output.isEmpty else { return }
print("outdated tools Swift packages:\n\(output)")
}
func checkProjectDependencies() throws {
guard let output = try Utilities.zsh("swift outdated", workingDirectoryURL: projectSwiftPMDirectoryURL), !output.isEmpty else { return }
guard let output = try Zsh.run(command: "swift outdated", directory: projectSwiftPMDirectoryURL), !output.isEmpty else { return }
print("outdated project Swift packages:\n\(output)")
}
}