]>
Git — Sourcephile - julm/rezine-rfcs.git/blob - scripts/new.sh
2 # Usage: scripts/new.sh [p|s]
3 # SPDX-FileCopyrightText: 2024 Julien Moutinho (adh14) <julm+rezine@autogeree.net>
4 # SPDX-License-Identifier: AGPL-3.0-or-later
5 # shellcheck disable=SC2086
6 # shellcheck disable=SC2154
10 test $# -le 0 || declare "$@"
12 rfcLastAdvocacy
=$(find "${0%/*}"/rfcs -maxdepth 1 -type d -name "$rfcCat*" | sort -n | tail -1)
13 rfcLastNum
=$(realpath --relative-to "${0%/*}"/rfcs "$rfcLastAdvocacy")
14 rfcLastNum
=${rfcLastNum#"$rfcCat"}
15 rfcNum
=$((rfcLastNum + 1))
16 rfcDir
="rfcs/$rfcCat$rfcNum"
17 rfcAdvocacy
="$rfcDir/advocacy.md"
20 cat >>"$rfcAdvocacy" <<EOF
24 title-prefix: "\${rfcOrga} RFC\${rfcTag}"
27 - ${rfcAuthor-"$(git config user.name) <<$(git config user.email)>>"}
31 SPDX-FileCopyrightText: $(date +%Y) ${rfcAuthor-"$(git config user.name) <$(git config user.email)>"}
32 SPDX-License-Identifier: CC-BY-4.0
33 RFC-Branch: ${rfcBranch}
34 RFC-Category: $(case "$rfcCat" in (p) echo problème;; (s) echo solution;; esac)
36 $(printf -- " - %s\n" ${rfcCompasses})
43 New RFC draft: $rfcAdvocacy
45 To preview: ${0%/*}/html.sh $rfcDir
46 To tag and push: ${0%/*}/tag.sh $rfcDir
47 To send mail: ${0%/*}/send.sh $rfcDir