File: JSONDocUpdate.sh

package info (click to toggle)
simpleitk 1.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 75,056 kB
  • sloc: cpp: 25,403; python: 3,060; sh: 1,131; ansic: 369; java: 260; cs: 215; makefile: 51; ruby: 47; tcl: 22
file content (33 lines) | stat: -rwxr-xr-x 1,108 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash

# Updates the documentation strings in the JSON files from the ITK Doxygen.
#
# Configuration for directories need to be manually done in the
# config_vars.sh file. The ITK Doxygen XML will automatically be
# downloaded if needed.
#
# Usage: JSONDocUpdate.sh Code/BasicFilters/json/SomeFilter.json
#

die() {
    echo "$@" 1>&2
    exit 1
}

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# Load configuration variable from file
. ${DIR}/config_vars.sh || die 'Unable to find local \"config_vars.sh\" configuration file.'

# Download the nightly Doxygen XML if needed
[ -e ${ITK_XML}/itkImage_8h.xml ] ||
      ( cd ${ITK_XML} &&
        echo "Downloading ITK Doxygen XML..." &&
        curl -O http://public.kitware.com/pub/itk/NightlyDoxygen/InsightDoxygenDocXml.tar.gz &&
        cd .. &&
        tar -zxf xml/InsightDoxygenDocXml.tar.gz ) ||
      die 'Unable to get ITK Doxygen XML'

# Does the work of extracting the string from the XML, and putting them into the JSON
${PYTHON_EXECUTABLE} "${DIR}/GenerateDoc.py" "$1"  ${ITK_XML} ||
  die 'Error running GenerateDoc.py'