#!/bin/bash
#
# Add deps for building the package
apk add build-base pkgconf openssl-dev
# Install rust toolchain if not installed
rustup toolchain install stable --profile minimal --no-self-update
# Build docs
cargo doc --no-deps
# Move to `public/` folder
mv target/doc public/
# `public/fw_client/index.html` is the main docs entrypoint, but assets in `public`
# are still needed, so add an `http-equiv=refresh` for a client-side redirect
#
# ref: https://www.w3.org/TR/WCAG20-TECHS/H76.html
echo '<meta http-equiv="refresh" content="0; url=fw_client/index.html">' > public/index.html
