OLD | NEW |
1 #!/usr/bin/env bash | 1 #!/usr/bin/env bash |
2 | 2 |
3 set -e | 3 set -e |
4 | 4 |
5 shopt -s nullglob | 5 shopt -s nullglob |
6 | 6 |
7 cd $(dirname "$0") | 7 cd $(dirname "$0") |
8 | 8 |
9 # Script which takes all the asciidoc git-*.txt files in this directory, renders | 9 # Script which takes all the asciidoc git-*.txt files in this directory, renders |
10 # them to html + manpage format using git 1.9's doc toolchain, then puts | 10 # them to html + manpage format using git 1.9's doc toolchain, then puts |
11 # them in depot_tools to be committed. | 11 # them in depot_tools to be committed. |
12 | 12 |
13 ensure_in_path() { | 13 ensure_in_path() { |
14 local CMD=$1 | 14 local CMD=$1 |
15 local PTH=$(which "$CMD") | 15 local PTH=$(which "$CMD") |
16 if [[ ! $PTH ]] | 16 if [[ ! $PTH ]] |
17 then | 17 then |
18 echo Must have "$CMD" on your PATH! | 18 echo Must have "$CMD" on your PATH! |
19 exit 1 | 19 exit 1 |
20 else | 20 else |
21 echo Using \'$PTH\' for ${CMD}. | 21 echo Using \'$PTH\' for ${CMD}. |
22 fi | 22 fi |
23 } | 23 } |
24 | 24 |
25 ensure_in_path xmlto | 25 ensure_in_path xmlto |
| 26 ensure_in_path hg |
26 | 27 |
27 DFLT_CATALOG_PATH="/usr/local/etc/xml/catalog" | 28 DFLT_CATALOG_PATH="/usr/local/etc/xml/catalog" |
28 if [[ ! $XML_CATALOG_FILES && -f "$DFLT_CATALOG_PATH" ]] | 29 if [[ ! $XML_CATALOG_FILES && -f "$DFLT_CATALOG_PATH" ]] |
29 then | 30 then |
30 # Default if you install doctools with homebrew on mac | 31 # Default if you install doctools with homebrew on mac |
31 export XML_CATALOG_FILES="$DFLT_CATALOG_PATH" | 32 export XML_CATALOG_FILES="$DFLT_CATALOG_PATH" |
32 echo Using \'$DFLT_CATALOG_PATH\' for \$XML_CATALOG_FILES. | 33 echo Using \'$DFLT_CATALOG_PATH\' for \$XML_CATALOG_FILES. |
33 fi | 34 fi |
34 | 35 |
35 # We pull asciidoc to get the right version | 36 # We pull asciidoc to get the right version |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 do | 245 do |
245 echo Copying ../man1/$x | 246 echo Copying ../man1/$x |
246 cp "git/Documentation/$x" ../man1 | 247 cp "git/Documentation/$x" ../man1 |
247 done | 248 done |
248 | 249 |
249 for x in "${MAN7_TARGETS[@]}" | 250 for x in "${MAN7_TARGETS[@]}" |
250 do | 251 do |
251 echo Copying ../man7/$x | 252 echo Copying ../man7/$x |
252 cp "git/Documentation/$x" ../man7 | 253 cp "git/Documentation/$x" ../man7 |
253 done | 254 done |
OLD | NEW |