From d3e8d6e5418aba540bc01e971fb2ebb729ba3405 Mon Sep 17 00:00:00 2001 From: Ruslan Aliev Date: Tue, 25 Mar 2025 10:19:49 -0500 Subject: [PATCH] Fix chart_version.sh script wc -l sometimes produces leading spaces [1], so it's necessary to trim them to maintain expected output format. [1] https://unix.stackexchange.com/questions/205906/extra-space-with-counted-line-number/205910#205910 Change-Id: Ic95c44fa56051ef94319e663bbc533f77dbc3d19 Signed-off-by: Ruslan Aliev --- tools/chart_version.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/chart_version.sh b/tools/chart_version.sh index 83a9166172..80f52b13c3 100755 --- a/tools/chart_version.sh +++ b/tools/chart_version.sh @@ -15,10 +15,10 @@ MINOR=$(echo $BASE_VERSION | cut -d. -f2); if git show-ref --tags $BASE_VERSION --quiet; then # if there is tag $BASE_VERSION, then we count the number of commits since the tag - PATCH=$(git log --oneline ${BASE_VERSION}.. $CHART_DIR | wc -l) + PATCH=$(git log --oneline ${BASE_VERSION}.. $CHART_DIR | wc -l | xargs) else # if there is no tag $BASE_VERSION, then we count the number of commits since the beginning - PATCH=$(git log --oneline $CHART_DIR | wc -l) + PATCH=$(git log --oneline $CHART_DIR | wc -l | xargs) fi COMMIT_SHA=$(git rev-parse --short HEAD);