feat: Begins update for more modern swift-dependencies implementation.

This commit is contained in:
2024-12-20 12:54:10 -05:00
parent 1885a90f62
commit 847ddbc7b5
19 changed files with 439 additions and 130 deletions

View File

@@ -1,11 +1,10 @@
import ArgumentParser
import CliVersion
import Dependencies
import Foundation
import CliVersion
import ShellClient
extension CliVersionCommand {
struct Generate: ParsableCommand {
static var configuration: CommandConfiguration = .init(
abstract: "Generates a version file in a command line tool that can be set via the git tag or git sha.",
@@ -15,6 +14,7 @@ extension CliVersionCommand {
@OptionGroup var shared: SharedOptions
// TODO: Use CliClient
func run() throws {
@Dependency(\.logger) var logger: Logger
@Dependency(\.fileClient) var fileClient
@@ -35,12 +35,10 @@ extension CliVersionCommand {
} else {
logger.info("Would generate file at: \(fileString)")
}
}
}
}
fileprivate enum GenerationError: Error {
private enum GenerationError: Error {
case fileExists(path: String)
}