feat: Integrates precedence with command-line options, needs documentation.
All checks were successful
CI / Ubuntu (push) Successful in 2m31s

This commit is contained in:
2024-12-28 23:43:56 -05:00
parent f1eb883b93
commit 9dd30a1745
6 changed files with 44 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
import Dependencies
import FileClient
import Foundation
import LoggingExtensions
@_spi(Internal)
public extension Configuration {
@@ -44,8 +45,12 @@ public extension Configuration.Branch {
@_spi(Internal)
public extension Configuration.SemVar {
func merging(_ other: Self?) -> Self {
.init(
@Dependency(\.logger) var logger
logger.dump(other, level: .trace) { "Merging semvar:\n\($0)" }
return .init(
allowPreRelease: other?.allowPreRelease ?? allowPreRelease,
precedence: other?.precedence ?? precedence,
preRelease: preRelease == nil ? other?.preRelease : preRelease!.merging(other?.preRelease),
requireExistingFile: other?.requireExistingFile ?? requireExistingFile,
requireExistingSemVar: other?.requireExistingSemVar ?? requireExistingSemVar,