daml/docs/scripts/preview.sh
Gary Verhaegen adc0b45f5f
faster docs preview (#7383)
There is generally little need to preview the PDF version of the docs.
Also, opening up the Python server on 0.0.0.0 (the default) triggers OS
warnings on macOS.

CHANGELOG_BEGIN
CHANGELOG_END
2020-09-16 14:12:59 +02:00

27 lines
564 B
Bash
Executable File

#!/usr/bin/env bash
# Copyright (c) 2020 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
SCRIPT_DIR=$(dirname "$0")
cd $SCRIPT_DIR
BUILD_DIR=$(cd ..; pwd)/build
trap cleanup 1 2 3 6
cleanup()
{
echo "Caught Signal ... cleaning up."
rm -rf $BUILD_DIR
echo "Done cleanup ... quitting."
exit 1
}
rm -rf $BUILD_DIR
mkdir $BUILD_DIR
bazel build //docs:docs-no-pdf
tar -zxf ../../bazel-bin/docs/html-only.tar.gz -C $BUILD_DIR
cd $BUILD_DIR/html
python -m http.server 8000 --bind 127.0.0.1