logo

utils

~/.local/bin tools and git-hooks
commit: f970c99907439d2b1898cd882857813dce561f85
parent: 513dd02c6d1fea9790e37e2a3b78c4cb8bd2cb25
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon, 18 Feb 2019 06:07:02 +0100

bin/archive-tags: Fix mkdir, only execute if file is absent

Diffstat:

Mbin/archive-tags8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/archive-tags b/bin/archive-tags @@ -1,17 +1,17 @@ #!/bin/sh workdir=$(git rev-parse --show-toplevel) name=$(basename ${workdir}) -mkdir "${workdir}.archives" +mkdir -p "${workdir}.archives" 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 \ + + test -f "${file}" || git archive \ --format tar.gz \ --prefix "${name}-${version}/" \ -o "${file}" \ -- \ "${tag}" - gpg --detach-sign "${file}" + test -f "${file}.sig" || gpg --detach-sign "${file}" done