Changeset View
Changeset View
Standalone View
Standalone View
scripts/fetch_documentation.sh
Show All 15 Lines | |||||
MIN_VERSION_MAN_PAGES='0.22.1' | MIN_VERSION_MAN_PAGES='0.22.1' | ||||
SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd) | SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd) | ||||
TOPLEVEL=$(git -C "${SCRIPT_DIR}" rev-parse --show-toplevel) | TOPLEVEL=$(git -C "${SCRIPT_DIR}" rev-parse --show-toplevel) | ||||
# Get the last MAX_RELEASES releases | # Get the last MAX_RELEASES releases | ||||
RELEASES=$(curl -L -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${GITHUB_OWNER}/${GITHUB_REPO}/releases?per_page=${MAX_RELEASES}) | RELEASES=$(curl -L -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${GITHUB_OWNER}/${GITHUB_REPO}/releases?per_page=${MAX_RELEASES}) | ||||
echo "${RELEASES}" > "${TOPLEVEL}"/_data/github-releases.json | |||||
# Extract releases version number | # Extract release version numbers | ||||
RELEASE_VERSIONS=($(echo ${RELEASES} | jq -r .[].name)) | RELEASE_VERSIONS=($(echo ${RELEASES} | jq -r .[].name)) | ||||
# Extract releases version number | # Extract release tags | ||||
RELEASE_TAGS=($(echo ${RELEASES} | jq -r .[].tag_name)) | RELEASE_TAGS=($(echo ${RELEASES} | jq -r .[].tag_name)) | ||||
# Create the cache directory as needed. This is where the sources will be | # Create the cache directory as needed. This is where the sources will be | ||||
# cloned, and where the docs will be built. | # cloned, and where the docs will be built. | ||||
: "${CACHE_DIR:=${TOPLEVEL}/.user-doc-cache}" | : "${CACHE_DIR:=${TOPLEVEL}/.user-doc-cache}" | ||||
mkdir -p "${CACHE_DIR}" | mkdir -p "${CACHE_DIR}" | ||||
SRC_DIR="${CACHE_DIR}/${GITHUB_REPO}" | SRC_DIR="${CACHE_DIR}/${GITHUB_REPO}" | ||||
▲ Show 20 Lines • Show All 139 Lines • Show Last 20 Lines |