]>
Git — Sourcephile - julm/rezine-rfcs.git/blob - scripts/send.sh
2 # SPDX-FileCopyrightText: 2024 Julien Moutinho (adh14) <julm+rezine@sourcephile.fr>
3 # SPDX-License-Identifier: AGPL-3.0-or-later
4 # shellcheck disable=SC2046
5 # shellcheck disable=SC2086
6 # shellcheck disable=SC2317
7 # To push and send mails:
8 # scripts/send.sh rfcs/p1
9 # To push without sending mails:
10 # scripts/send.sh rfcs/p1 no_git_send_email=set git_push=--force
14 test $# -le 0 || declare "$@"
17 removeAtExit
+=("$coverLetter")
18 mimepart_alternative
=$(uuidgen)
19 mimepart_related
=$(uuidgen)
24 #rfcPDF -o "$rfcDir/${rfcRepo}-${rfcTag}".pdf
26 git_push_remote
=${git_push_remote-origin}
28 if test ! "${no_git_send_email:+set}"; then
33 --template "${0%/*}"/..
/styles
/rfc.header.
mail \
37 Content-Disposition: inline
39 Content-Type: multipart/alternative; boundary="--==_mimepart_alternative_$mimepart_alternative"
40 Content-Transfer-Encoding: UTF-8
45 ----==_mimepart_alternative_$mimepart_alternative
46 Content-Type: text/plain; charset=UTF-8
47 Content-Transfer-Encoding: UTF-8
51 Vous lisez actuellement ce mél dans son format de texte brut,
52 vous _devriez_ le lire dans son format HTML, qui est plus soigné.
60 ----==_mimepart_alternative_$mimepart_alternative
61 Content-Type: multipart/related; boundary="--==_mimepart_related_$mimepart_related"
62 Content-Transfer-Encoding: UTF-8
64 ----==_mimepart_related_$mimepart_related
65 Content-Type: text/html; charset=UTF-8
66 Content-Transfer-Encoding: UTF-8
69 cat "$rfcDir"/index.html
71 ----==_mimepart_related_$mimepart_related
73 ----==_mimepart_alternative_$mimepart_alternative
77 # FIXME: the PDF rendition is not good
79 #----==_mimepart_mixed_$mimepart_mixed
80 #Content-Type: application/pdf; name="RFC$rfcTag.pdf"
81 #Content-Transfer-Encoding: base64
82 #Content-Disposition: attachment; filename*0="RFC$rfcTag."; filename*1=pdf
85 #base64 --wrap 76 "$rfcDir/$rfcRepo-$rfcTag".pdf
89 patchesDir
=$(mktemp -d)
90 removeAtExit
+=("$patchesDir")
91 git format
-patch "${git_push_remote}/${rfcBranch}..$rfcTag" \
92 --output-directory "$patchesDir" \
93 "$rfcDir" ':!*.html' ':!*.csl.json'
95 rfcAdvocacyMeta
=$(mktemp --suffix ".json")
96 removeAtExit
+=("$rfcAdvocacyMeta")
97 pandoc
-o "$rfcAdvocacyMeta" --to plain \
98 --template "$rfcRoot"/styles
/metadata.json \
100 git send
-email ${git_send_email-} \
101 --to "$(jq -r .To <"$rfcAdvocacyMeta" | sed -e '/^null$/d')" \
102 --cc "$(jq -r .Cc <"$rfcAdvocacyMeta" | sed -e '/^null$/d')" \
104 --8bit-encoding UTF
-8 \
105 --cover-letter "$coverLetter" \
109 if test ! "${no_git_push:+set}"; then
110 git push
${git_push-} --follow-tags "$git_push_remote" "$rfcTag"
111 rfcTagRev
=$(git rev-list "$rfcTag" -1)
112 git push
${git_push-} "$git_push_remote" "$rfcTagRev:refs/heads/$rfcBranch"
113 git push
${git_push-} "$git_push_remote" "$rfcTagRev:refs/heads/$rfcBranchRevision"
114 git push
${git_push-} "$git_push_remote"