tldr/scripts/build.sh
a1346054 5c62e303b5
*: shellcheck and fix typos (#6526)
* test.sh: quote a variable

* contributing-guides/*: fix typos

* pages/*: fix typos

* scripts/*: fix typos

* MAINTAINERS.md: trim trailing whitespace

Co-authored-by: a1346054 <36859588+a1346054@users.noreply.github.com>
2021-09-16 00:32:13 -03:00

34 lines
677 B
Bash
Executable File

#!/usr/bin/env bash
# SPDX-License-Identifier: MIT
# This script is executed by GitHub Actions for every successful push (on any branch, PR or not).
set -ex
function initialize {
if [ -z "$TLDRHOME" ]; then
export TLDRHOME=${GITHUB_WORKSPACE:-$(pwd)}
fi
export TLDR_ARCHIVE="tldr.zip"
}
function build_index {
npm run build-index
echo "Pages index successfully built."
}
function build_archive {
rm -f "$TLDR_ARCHIVE"
cd "$TLDRHOME/"
zip -q -r "$TLDR_ARCHIVE" pages* LICENSE.md index.json
echo "Pages archive successfully built."
}
###################################
# MAIN
###################################
initialize
build_index
build_archive