anastasis

Credential backup and recovery protocol and service
Log | Files | Refs | Submodules | README | LICENSE

update-tos.sh (1092B)


      1 #!/bin/sh
      2 # This file is in the public domain
      3 
      4 # Should be called with the list of languages to generate, i.e.
      5 # $ ./update-tos.sh en de fr it
      6 
      7 # Error checking on
      8 set -eu
      9 
     10 if ! htmlark --version >/dev/null; then
     11   echo "htmlark not installed"
     12   echo "Run 'pip install htmlark'"
     13   exit 1
     14 fi
     15 
     16 echo "Generating TOS for ETag $VERSION"
     17 
     18 rm -f sphinx.log sphinx.err
     19 # We process inputs using Makefile in tos/ directory
     20 cd tos
     21 for l in $@
     22 do
     23     mkdir -p $l
     24     echo Generating TOS for language $l
     25     # 'f' is for the supported formats, note that the 'make' target
     26     # MUST match the file extension.
     27     for f in html txt pdf epub xml
     28     do
     29         rm -rf _build
     30         echo "  Generating format $f"
     31         make -e SPHINXOPTS="-D language='$l'" $f >>sphinx.log 2>>sphinx.err < /dev/null
     32         if test $f = "html"
     33         then
     34             htmlark -o $l/${VERSION}.$f _build/$f/${VERSION}.$f
     35         else
     36             mv _build/$f/${VERSION}.$f $l/${VERSION}.$f
     37         fi
     38         if test $f = "txt"
     39         then
     40             cp $l/${VERSION}.$f $l/${VERSION}.md
     41         fi
     42     done
     43 done
     44 cd ..