From 5f3ebf55c5646545c2494fe11b49524b7fc109c5 Mon Sep 17 00:00:00 2001 From: Ruben Momoa Date: Mon, 26 Aug 2024 14:17:16 +0200 Subject: [PATCH] final tags fix [SKIP CI] --- gen-tag-list.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/gen-tag-list.sh b/gen-tag-list.sh index 2870132..2c79618 100755 --- a/gen-tag-list.sh +++ b/gen-tag-list.sh @@ -2,7 +2,6 @@ # this script generates a tags_file for Buildx (https://woodpecker-ci.org/plugins/Docker%20Buildx) - # Check if a command-line argument is provided if [ -z "$1" ]; then echo "Please provide a version as a command-line argument." @@ -20,11 +19,7 @@ if [[ "${version:0:1}" == "V" || "${version:0:1}" == "v" ]]; then version="${version#?}" fi -# Split the version into an array using the "." as a delimiter -# this sets $1 $2 and $3 -IFS='.' set -- "$version" - echo "latest$suffix" > tags.txt -echo "$1$suffix" >> tags.txt -echo "$1.$2$suffix" >> tags.txt -echo "$1.$2.$3$suffix" >> tags.txt \ No newline at end of file +echo "$version" | cut -d'.' -f1 | xargs -I {} echo "{}$suffix" >> tags.txt +echo "$version" | cut -d'.' -f1,2 | xargs -I {} echo "{}$suffix" >> tags.txt +echo "$version" | cut -d'.' -f1,2,3 | xargs -I {} echo "{}$suffix" >> tags.txt \ No newline at end of file