#!/bin/bash

set -ex

script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "${script_dir}"

export PATH=${BASE}/node_modules/.bin:$PATH

echo "Docs directory: $script_dir"

# Change baseUrl to '/depindev/'
sed -i "s|/depin/|/depindev/|g" docusaurus.config.ts ./src/pages/index.tsx

#bun build
#bun ${script_dir}/node_modules/.bin/docusaurus build
pnpm build

rsync -rv --delete ${script_dir}/build/ root@info.ourworld.tf:/root/hero/www/info/depindev

# Change baseUrl to '/depin/'
sed -i "s|/depindev/|/depin/|g" docusaurus.config.ts ./src/pages/index.tsx