2022-06-20 01:30:32 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# shellcheck disable=SC2059
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
set -o nounset
|
|
|
|
set -o pipefail
|
|
|
|
|
2023-09-22 05:07:40 +03:00
|
|
|
OFFLINE=
|
|
|
|
while [[ $# -gt 0 ]]; do
|
2023-11-24 09:07:21 +03:00
|
|
|
case $1 in
|
|
|
|
--offline)
|
|
|
|
OFFLINE=1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
2023-09-22 05:07:40 +03:00
|
|
|
done
|
|
|
|
|
2022-06-20 01:30:32 +03:00
|
|
|
# Change to the root directory of the repository
|
|
|
|
cd "$(git rev-parse --show-toplevel)"
|
|
|
|
|
|
|
|
cd web
|
|
|
|
|
2023-11-24 09:07:21 +03:00
|
|
|
if [ ! "$OFFLINE" ]; then
|
|
|
|
echo "Installing npm modules for the owncast web..."
|
|
|
|
npm --silent install 2>/dev/null
|
2023-09-22 05:07:40 +03:00
|
|
|
fi
|
2022-06-20 01:30:32 +03:00
|
|
|
|
|
|
|
echo "Building owncast web..."
|
|
|
|
rm -rf .next
|
2023-11-24 09:07:21 +03:00
|
|
|
node_modules/.bin/next build | grep info
|
2022-06-20 01:30:32 +03:00
|
|
|
|
2022-09-11 01:37:07 +03:00
|
|
|
echo "Copying web project to dist directory..."
|
2022-06-20 01:30:32 +03:00
|
|
|
|
|
|
|
# Remove the old one
|
|
|
|
rm -rf ../static/web
|
|
|
|
|
|
|
|
# Copy over the new one
|
|
|
|
mv ./out ../static/web
|
|
|
|
|
|
|
|
echo "Done."
|