From 8ee8c10ba620c7fe8250dee15c09c12dc5aab5cf Mon Sep 17 00:00:00 2001 From: Alex Guretzki Date: Fri, 1 Nov 2024 14:33:55 +0100 Subject: [PATCH] Only showing the branch name in the output (#37) Co-authored-by: Alex Guretzki --- .../CommandLineTool/ProjectToOutputCommand.swift | 4 ++-- .../PADProjectBuilder/PADProjectSource.swift | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Sources/ExecutableTargets/CommandLineTool/ProjectToOutputCommand.swift b/Sources/ExecutableTargets/CommandLineTool/ProjectToOutputCommand.swift index 8018053..5b8041a 100644 --- a/Sources/ExecutableTargets/CommandLineTool/ProjectToOutputCommand.swift +++ b/Sources/ExecutableTargets/CommandLineTool/ProjectToOutputCommand.swift @@ -102,8 +102,8 @@ struct ProjectToOutputCommand: AsyncParsableCommand { for: changes, warnings: warnings, allTargets: projectBuilderResult.swiftInterfaceFiles.map(\.name).sorted(), - oldVersionName: oldSource.description, - newVersionName: newSource.description + oldVersionName: oldSource.title, + newVersionName: newSource.title ) // MARK: - diff --git a/Sources/PublicModules/PADProjectBuilder/PADProjectSource.swift b/Sources/PublicModules/PADProjectBuilder/PADProjectSource.swift index 1f05dd2..d1e2cb3 100644 --- a/Sources/PublicModules/PADProjectBuilder/PADProjectSource.swift +++ b/Sources/PublicModules/PADProjectBuilder/PADProjectSource.swift @@ -48,4 +48,13 @@ public enum ProjectSource: Equatable, CustomStringConvertible { return "\(repository) @ \(branch)" } } + + public var title: String { + switch self { + case let .local(path): + return path + case let .git(branch, _): + return "\(branch)" + } + } }