meta:archive: Use stderr for log messages

This commit is contained in:
2022-03-31 03:11:32 +02:00
parent 98b33cc615
commit 82a4dc8e19

View File

@@ -49,15 +49,15 @@ for file in "${to_archive[@]}"; do
done done
if rmdir "$tmpd" 2>/dev/null; then if rmdir "$tmpd" 2>/dev/null; then
echo "Nothing to archive" >&2 echo "Nothing to archive"
else else
name="existing-$(date +"%Y%m%d_%H%M%S").tar.gz" name="existing-$(date +"%Y%m%d_%H%M%S").tar.gz"
if tar czvf "$name" "$tmpd"; then if tar czvf "$name" "$tmpd"; then
rm -rf "$tmpd" rm -rf "$tmpd"
echo "$name created" >&2 echo "$name created"
else else
errc=$? errc=$?
echo "Archive could not be created. See $tmpd." >&2 echo "Archive could not be created. See $tmpd."
exit $errc exit $errc
fi fi
fi fi