This commit is contained in:
2023-03-14 21:42:11 -04:00
parent 323c96b3bc
commit 8c5f33b7ec

View File

@@ -18,7 +18,7 @@ extension GitVersionCommand {
name: .customLong("git-directory"), name: .customLong("git-directory"),
help: "The git directory for the version." help: "The git directory for the version."
) )
var gitDirectory: String? = nil var gitDirectory: String
func run() throws { func run() throws {
try withDependencies { try withDependencies {
@@ -28,10 +28,13 @@ extension GitVersionCommand {
} operation: { } operation: {
@Dependency(\.gitVersionClient) var gitVersion @Dependency(\.gitVersionClient) var gitVersion
@Dependency(\.fileClient) var fileClient @Dependency(\.fileClient) var fileClient
@Dependency(\.logger) var logger @Dependency(\.logger) var logger: Logger
logger.info("Building with git-directory: \(gitDirectory)")
let fileUrl = URL(fileURLWithPath: outputPath) let fileUrl = URL(fileURLWithPath: outputPath)
let fileString = fileUrl.fileString() let fileString = fileUrl.fileString()
logger.info("File Url: \(fileString)")
let currentVersion = try gitVersion.currentVersion(in: gitDirectory) let currentVersion = try gitVersion.currentVersion(in: gitDirectory)