sass-site/tool/typedoc-build.sh

36 lines
716 B
Bash
Raw Permalink 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
git clean -fX
2023-05-19 19:24:15 +02:00
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