logo

utils

~/.local/bin tools and git-hooks
commit: 513dd02c6d1fea9790e37e2a3b78c4cb8bd2cb25
parent: a369170204898da2a974dbf68511f08fe39d53bb
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Tue,  8 Jan 2019 09:27:15 +0100

bin/archive-tags: Only use tags prefixed with a v

Diffstat:

Mbin/archive-tags13+++++++------
1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/bin/archive-tags b/bin/archive-tags @@ -2,15 +2,16 @@ workdir=$(git rev-parse --show-toplevel) name=$(basename ${workdir}) mkdir "${workdir}.archives" -git tag -l | while read -r t; do - f="${workdir}.archives/${name}-$(echo "${t}" | tr '/' '_').tar.gz" +git tag -l | grep '^v' | while read -r tag; do + version=$(echo $tag | sed 's/^v//') + file="${workdir}.archives/${name}-$(echo "${version}" | tr '/' '_').tar.gz" test -f "${f}" && continue git archive \ --format tar.gz \ - --prefix "${name}-${t}/" \ - -o "${f}" \ + --prefix "${name}-${version}/" \ + -o "${file}" \ -- \ - "${t}" + "${tag}" - gpg --detach-sign "${f}" + gpg --detach-sign "${file}" done