1#!/bin/bash 2 3set -ex 4 5if [ -n "$KATEX" ]; then 6 apt-get update 7 # Ignore error if gpg-agent doesn't exist (for Ubuntu 16.04) 8 apt-get install -y gpg-agent || : 9 10 curl --retry 3 -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - 11 sudo apt-get install -y nodejs 12 13 curl --retry 3 -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - 14 echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list 15 16 apt-get update 17 apt-get install -y --no-install-recommends yarn 18 yarn global add katex --prefix /usr/local 19 20 sudo apt-get -y install doxygen 21 22 apt-get autoclean && apt-get clean 23 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 24 25fi 26