Beam/Tools/Sources/OutdatedPackages.swift
Mauro ca319e0bfe
Dpendencies update + improved dependencies version management (#721)
* updating dependencies

* minor version pinning

* update completed and also added a tool that checks for outdated swiftpm packages

* changelog

* DTCoreText uses exact version

* minor version for analytics

* pushing OutdatedPackages

* package.swift for the repo also using upToNextMinor

* fixing a typo

* Update Tools/Sources/OutdatedPackages.swift

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

* Update Tools/Sources/SetupProject.swift

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>

* removing unused comment

* removed trailing comma

---------

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
2023-03-23 11:26:20 +01:00

24 lines
1006 B
Swift

import ArgumentParser
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.appending(path: "ElementX.xcodeproj/project.xcworkspace/xcshareddata/swiftpm") }
func run() throws {
try checkToolsDependencies()
try checkProjectDependencies()
}
func checkToolsDependencies() throws {
guard let output = try Utilities.zsh("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 }
print("outdated project Swift packages:\n\(output)")
}
}