refactoring in format
improve performance
This commit is contained in:
parent
58f4a04f5c
commit
316ec13831
24
git-snapsign
24
git-snapsign
@ -162,16 +162,20 @@ trap 'rm -rf "${tmpdir}"' EXIT HUP INT QUIT TERM
|
|||||||
if [[ -n "${tag}" ]]; then
|
if [[ -n "${tag}" ]]; then
|
||||||
archive="${tmpdir}/${prefix}-${tag#v}.${format}"
|
archive="${tmpdir}/${prefix}-${tag#v}.${format}"
|
||||||
|
|
||||||
if [ "$format" == "tar.lz" ]; then
|
case "${format}" in
|
||||||
git archive --format=tar --prefix "${prefix}-${tag#v}/" \
|
tar.lz)
|
||||||
"${tag}" | lzip -c > "${archive}"
|
git archive --format=tar --prefix "${prefix}-${tag#v}/" \
|
||||||
elif [ "$format" == "tar.xz" ]; then
|
"${tag}" | lzip -c > "${archive}"
|
||||||
git archive --format=tar --prefix "${prefix}-${tag#v}/" \
|
;;
|
||||||
"${tag}" | xz -c > "${archive}"
|
tar.xz)
|
||||||
else
|
git archive --format=tar --prefix "${prefix}-${tag#v}/" \
|
||||||
git archive --format "${format}" --prefix "${prefix}-${tag#v}/" \
|
"${tag}" | xz -c > "${archive}"
|
||||||
--output "${archive}" "${tag}"
|
;;
|
||||||
fi
|
*)
|
||||||
|
git archive --format "${format}" --prefix "${prefix}-${tag#v}/" \
|
||||||
|
--output "${archive}" "${tag}"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
if ! "${gpg:-gpg}" --output "${archive}.asc" --armor \
|
if ! "${gpg:-gpg}" --output "${archive}.asc" --armor \
|
||||||
--sign-with "${keyid}" --detach-sign <"${archive}"
|
--sign-with "${keyid}" --detach-sign <"${archive}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user