Chart.js/scripts/docs-config.sh
Evert Timberg ff354cc5b8
Remove release branch workflow (#7827)
* GitHub actions uses locked install for CI
* Add initial GitHub action to publish to NPM
* Detect the NPM tag (latest vs next) depending on the git tag
* Deploy docs from releases & master commits
* Remove Travis CI
* Update repo badge to use actions status
* Remove Travis env vars and update docs-config to take a parameter
* Update publish script regex to match other scripts
* Deploy docs action only runs in one spot
2020-10-13 17:12:19 -04:00

23 lines
415 B
Bash
Executable File

#!/bin/bash
set -e
VERSION=$1
# Note: this code also exists in deploy.sh
# tag is next|latest|master
# https://www.chartjs.org/docs/$tag/
function update_config {
local tag=''
if [ "$VERSION" == "master" ]; then
tag=master
elif [[ "$VERSION" =~ ^[^-]+$ ]]; then
tag=latest
else
tag=next
fi
sed -i -e "s/VERSION/$tag/g" "docs/docusaurus.config.js"
}
update_config