logo

utils

~/.local/bin tools and git-hooks git clone https://hacktivis.me/git/utils.git
commit: 2a292faf7ff5e9a364533f21b4f58a3b86b099ab
parent 1a177a52cd0cf51dc7697790bf36de20b8f42b35
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Thu, 10 Feb 2022 01:13:14 +0100

bin/archive-tags: Add quotes to prevent splits

Diffstat:

Mbin/archive-tags6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/archive-tags b/bin/archive-tags @@ -1,9 +1,9 @@ #!/bin/sh -workdir=$(git rev-parse --show-toplevel) -name=$(basename ${workdir}) +workdir="$(git rev-parse --show-toplevel)" +name="$(basename "${workdir}")" mkdir -p "${workdir}.archives" git tag -l | grep '^v' | while read -r tag; do - version=$(echo $tag | sed 's/^v//') + version="$(echo "$tag" | sed 's/^v//')" file="${workdir}.archives/${name}-$(echo "${version}" | tr '/' '_').tar.gz" test -f "${file}" || git archive \