mirror of
https://github.com/tldr-pages/tldr.git
synced 2024-11-10 11:29:59 +03:00
7a28aef527
Move the duplication of the index.json file in the build.sh script instead of the npm build-index script. This makes things cleaner.
34 lines
662 B
Bash
34 lines
662 B
Bash
#!/usr/bin/env bash
|
|
|
|
# This script is executed by Travis CI for every successful push (on any branch, PR or not).
|
|
set -ex
|
|
|
|
function initialize {
|
|
if [ -z "$TLDRHOME" ]; then
|
|
export TLDRHOME=${TRAVIS_BUILD_DIR:-$(pwd)}
|
|
fi
|
|
|
|
export TLDR_ARCHIVE="tldr.zip"
|
|
}
|
|
|
|
function build_index {
|
|
npm run build-index
|
|
cp index.json pages/
|
|
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
|