sass-site/tool/typedoc-build.sh

35 lines
702 B
Bash
Raw Normal View History

2023-05-19 19:24:15 +02:00
#!/usr/bin/env bash
# Exit on error or pipe failure
set -eo pipefail
# Print each command and its arguments
set -x
# Clone and fetch the sass/sass repo
if [[ ! -d ".language" ]]; then
git clone https://github.com/sass/sass .language
fi
cd .language
git fetch
if [[ "$LANGUAGE_REVISION" ]]; then
git checkout "$LANGUAGE_REVISION"
else
git checkout origin/main
fi
cd ..
# Build the JS API docs
cd .language
npm install
ln -sf ../.language/node_modules ../tool/node_modules
npm run typedoc -- \
--plugin ../tool/typedoc-theme.js --theme sass-site \
--out ../source/documentation/js-api \
--cleanOutputDir
cd ..
rm -r source/documentation/js-api/assets
# Turn off printing commands
set +x