"wip"
This commit is contained in:
2
Sources/example/Version.swift
Normal file
2
Sources/example/Version.swift
Normal file
@@ -0,0 +1,2 @@
|
||||
// Do not change this value, it is set by the build script.
|
||||
let VERSION: String? = nil
|
||||
24
Sources/example/example.swift
Normal file
24
Sources/example/example.swift
Normal 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)")
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user