2019-04-24 18:18:10 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# (A) Update `FORMULA` with `${nextRelease.version}`
|
|
|
|
###############################################################################
|
|
|
|
sed -i -e "s_^\(version:\).*_\1 ${1}_" FORMULA
|
|
|
|
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# (B) Use `m2r` to convert automatically produced `.md` docs to `.rst`
|
|
|
|
###############################################################################
|
|
|
|
|
|
|
|
# Install `m2r`
|
|
|
|
sudo -H pip install m2r
|
|
|
|
|
2020-05-14 01:27:23 +02:00
|
|
|
# working directory
|
|
|
|
MYPWD=$( pwd )
|
|
|
|
|
2019-04-24 18:18:10 +02:00
|
|
|
# Copy and then convert the `.md` docs
|
2019-11-27 22:00:38 +01:00
|
|
|
cp ./*.md docs/
|
|
|
|
cd docs/ || exit
|
|
|
|
m2r --overwrite ./*.md
|
2019-04-24 18:18:10 +02:00
|
|
|
|
|
|
|
# Change excess `H1` headings to `H2` in converted `CHANGELOG.rst`
|
|
|
|
sed -i -e '/^=.*$/s/=/-/g' CHANGELOG.rst
|
|
|
|
sed -i -e '1,4s/-/=/g' CHANGELOG.rst
|
|
|
|
|
|
|
|
# Use for debugging output, when required
|
|
|
|
# cat AUTHORS.rst
|
|
|
|
# cat CHANGELOG.rst
|
|
|
|
|
|
|
|
# Return back to the main directory
|
2020-05-14 01:27:23 +02:00
|
|
|
cd "${MYPWD}" || exit
|