1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 08:42:08 +02:00
tldr/scripts/build.sh
bl-ue d607f853be
scripts/*.sh: set executable permission (#5461)
In most repos, executable shell scripts have the executable bit set.
2021-03-31 00:32:17 +01:00

32 lines
644 B
Bash
Executable file

#!/usr/bin/env bash
# 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 succesfully built."
}
function build_archive {
rm -f "$TLDR_ARCHIVE"
cd "$TLDRHOME/"
zip -q -r "$TLDR_ARCHIVE" pages* LICENSE.md index.json
echo "Pages archive succesfully built."
}
###################################
# MAIN
###################################
initialize
build_index
build_archive