Add POT setup script.

This commit is contained in:
erinhmclark
2025-03-17 20:34:00 +00:00
parent 8548b7def7
commit e6b1a8c893
2 changed files with 30 additions and 6 deletions

View File

@@ -0,0 +1,25 @@
#!/bin/bash
set -e
SCRIPTS_DIR="scripts/potoken_provider"
BGUTIL_DIR="$SCRIPTS_DIR/bgutil-ytdlp-pot-provider"
# Clone the repository, or update if it exists
if [ ! -d "$BGUTIL_DIR" ]; then
echo "Cloning bgutil-ytdlp-pot-provider repository..."
git clone https://github.com/Brainicism/bgutil-ytdlp-pot-provider.git "$BGUTIL_DIR"
else
echo "Updating existing bgutil-ytdlp-pot-provider repository..."
cd "$BGUTIL_DIR" || exit 1
git pull origin master
fi
# Move into the server directory
cd "$BGUTIL_DIR/server" || exit 1
# Install dependencies and transpile the script
yarn install --frozen-lockfile
npx tsc
# The built script is now available
echo "PO Token provider script is ready: $BGUTIL_DIR/server/build/generate_once.js"