From dadd8377fa92de99941e4a27c54c63760879236e Mon Sep 17 00:00:00 2001 From: Pat Garrity Date: Fri, 22 Mar 2024 22:11:55 -0500 Subject: [PATCH] Fixing the process output parsing. --- README.md | 7 +++++++ src/main/scala/gs/Git.scala | 7 +++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index da7fa26..6fa2136 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,13 @@ On any project within the build: ### Publishing a Release +If the `release` property is set, a release build will be produced. The valid +values for `release` are: + +- `major` +- `minor` +- `patch` + ``` sbt -Drelease=minor publish ``` diff --git a/src/main/scala/gs/Git.scala b/src/main/scala/gs/Git.scala index 7f68e04..1aa22a1 100644 --- a/src/main/scala/gs/Git.scala +++ b/src/main/scala/gs/Git.scala @@ -33,8 +33,11 @@ object Git { if (result.exitCode != 0) SemVer.DefaultVersion - else - SemVer.parse(result.out.text()).getOrElse(SemVer.DefaultVersion) + else { + // Note: this value may contain newlines! + val processOutput = result.out.text().trim() + SemVer.parse(processOutput).getOrElse(SemVer.DefaultVersion) + } } }