This commit is contained in:
2023-03-12 23:02:11 -04:00
parent 7d69982605
commit b0559d9726
12 changed files with 472 additions and 156 deletions

View File

@@ -0,0 +1,2 @@
// Do not change this value, it is set by the build script.
let VERSION: String? = nil

View File

@@ -0,0 +1,24 @@
import ArgumentParser
import ShellClient
/// An example of using the git version client with a command line tool
/// The ``VERSION`` variable get's set during the build process.
@main
public struct Example: ParsableCommand {
public static let configuration: CommandConfiguration = .init(
abstract: "An example of using the `GitVersion` command to set the version for a command line app.",
version: VERSION ?? "0.0.0"
)
public init() { }
public func run() throws {
@Dependency(\.logger) var logger: Logger
let version = (VERSION ?? "0.0.0").blue
logger.info("Version: \(version)")
}
}