]> begriffs open source - cmsis-freertos/blob - DoxyGen/check_links.sh
Corrected osKernelGetSysTimerCount not to call __disable_irq if interrupts are alread...
[cmsis-freertos] / DoxyGen / check_links.sh
1 #!/bin/bash
2
3 set -o pipefail
4
5 DIRNAME=$(dirname $(realpath $0))
6 REQUIRED_GEN_PACK_LIB="0.6.0"
7
8 ############ gen-pack library ###########
9
10 function install_lib() {
11   local URL="https://github.com/Open-CMSIS-Pack/gen-pack/archive/refs/tags/v$1.tar.gz"
12   echo "Downloading gen_pack lib to '$2'"
13   mkdir -p "$2"
14   curl -L "${URL}" -s | tar -xzf - --strip-components 1 -C "$2" || exit 1
15 }
16
17 function load_lib() {
18   if [[ -d ${GEN_PACK_LIB} ]]; then
19     . "${GEN_PACK_LIB}/gen-pack"
20     return 0
21   fi
22   local GLOBAL_LIB="/usr/local/share/gen-pack/${REQUIRED_GEN_PACK_LIB}"
23   local USER_LIB="${HOME}/.local/share/gen-pack/${REQUIRED_GEN_PACK_LIB}"
24   if [[ ! -d "${GLOBAL_LIB}" && ! -d "${USER_LIB}" ]]; then
25     echo "Required gen-pack lib not found!" >&2
26     install_lib "${REQUIRED_GEN_PACK_LIB}" "${USER_LIB}"
27   fi
28
29   if [[ -d "${GLOBAL_LIB}" ]]; then
30     . "${GLOBAL_LIB}/gen-pack"
31   elif [[ -d "${USER_LIB}" ]]; then
32     . "${USER_LIB}/gen-pack"
33   else
34     echo "Required gen-pack lib is not installed!" >&2
35     exit 1
36   fi
37 }
38
39 load_lib
40 find_linkchecker
41
42 #########################################
43
44 check_links "${DIRNAME}/../Documentation/index.html" "${DIRNAME}"