1#!/bin/bash 2# Copyright (c) Meta Platforms, Inc. and affiliates. 3# All rights reserved. 4# 5# This source code is licensed under the BSD-style license found in the 6# LICENSE file in the root directory of this source tree. 7 8set -ex 9 10if [ -n "$BUILD_DOCS" ]; then 11 apt-get update 12 # Ignore error if gpg-agent doesn't exist (for Ubuntu 16.04) 13 apt-get install -y gpg-agent || : 14 15 curl --retry 3 -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - 16 sudo apt-get install -y nodejs 17 18 curl --retry 3 -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - 19 echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list 20 21 apt-get update 22 apt-get install -y --no-install-recommends yarn 23 yarn global add katex --prefix /usr/local 24 25 sudo apt-get -y install doxygen 26 27 apt-get autoclean && apt-get clean 28 rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 29 30fi 31