refactoring in format

improve performance
This commit is contained in:
Jesús 2021-01-26 18:22:27 -05:00
parent 58f4a04f5c
commit 316ec13831
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

View File

@ -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}"