mirror of
https://github.com/kalkih/mini-graph-card.git
synced 2025-12-20 00:35:56 +01:00
Only happens while releasing on master: * `NEXT_VERSION` should be used in all the `README.md` `since` columns. * Links and url will automatically be updated to the latest release
26 lines
720 B
Bash
Executable File
26 lines
720 B
Bash
Executable File
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
VERSION=$1
|
|
BRANCH=$2
|
|
|
|
if [ -z "${VERSION}" ]; then
|
|
echo "Version not specified; Exiting."
|
|
exit 1;
|
|
fi
|
|
if [ -z "${BRANCH}" ]; then
|
|
echo "Version not specified; Exiting."
|
|
exit 1;
|
|
fi
|
|
|
|
if [ ! "${BRANCH}" = "refs/heads/master" ]; then
|
|
echo "Branch is ${BRANCH}; README.md not updated."
|
|
exit 0;
|
|
fi
|
|
|
|
sed -i -e "s/NEXT_VERSION/v${VERSION}/g" ./README.md
|
|
sed -i -e "s|https://github.com/kalkih/mini-graph-card/releases/download/.*/mini-graph-card-bundle.js|https://github.com/kalkih/mini-graph-card/releases/download/v${VERSION}/mini-graph-card-bundle.js|g" ./README.md
|
|
sed -i -e "s|-\surl:\s/local/mini-graph-card-bundle.js?v=.*|- url: /local/mini-graph-card-bundle.js?v=${VERSION}|g" ./README.md
|
|
|