73 lines
2.5 KiB
Bash
Executable File
73 lines
2.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
cd "${script_dir}"
|
|
|
|
echo "Docs directory: $script_dir"
|
|
|
|
# Function to check if a command exists
|
|
command_exists() {
|
|
command -v "$1" >/dev/null 2>&1
|
|
}
|
|
|
|
# Check operating system
|
|
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
echo "Detected macOS system"
|
|
|
|
# Check if Homebrew is installed
|
|
if ! command_exists brew; then
|
|
echo "Homebrew is not installed. Installing..."
|
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
fi
|
|
|
|
# Install Node.js if not present
|
|
if ! command_exists node; then
|
|
echo "Node.js is not installed. Installing with Homebrew..."
|
|
brew install node
|
|
fi
|
|
|
|
# Install pnpm if not present
|
|
if ! command_exists pnpm; then
|
|
echo "pnpm is not installed. Installing with npm..."
|
|
npm install -g pnpm
|
|
fi
|
|
|
|
elif [[ "$OSTYPE" == "linux-gnu"* ]] && command_exists apt-get; then
|
|
echo "Detected Ubuntu system"
|
|
|
|
# Update package list
|
|
sudo apt-get update
|
|
|
|
# Install Node.js if not present
|
|
if ! command_exists node; then
|
|
echo "Node.js is not installed. Installing with apt..."
|
|
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
|
|
sudo apt-get install -y nodejs
|
|
fi
|
|
|
|
# Install pnpm if not present
|
|
if ! command_exists pnpm; then
|
|
echo "pnpm is not installed. Installing with npm..."
|
|
sudo npm install -g pnpm
|
|
fi
|
|
|
|
else
|
|
echo "Error: This script only supports macOS or Ubuntu systems"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Installing dependencies..."
|
|
export PATH=${BASE}/node_modules/.bin:$PATH
|
|
|
|
pnpm install @docusaurus/core @docusaurus/preset-classic @docusaurus/theme-mermaid
|
|
pnpm install react-player
|
|
pnpm install tailwindcss
|
|
pnpm install --save-dev @types/node @docusaurus/types @docusaurus/preset-classic prism-react-renderer redocusaurus
|
|
# pnpm add redocusaurus
|
|
pnpm add tailwindcss-animate class-variance-authority clsx tailwind-merge lucide-react
|
|
# #pnpm dlx shadcn@latest init
|
|
# pnpm dlx shadcn@latest add accordion alert alert-dialog aspect-ratio avatar badge breadcrumb button calendar card carousel chart checkbox collapsible command context-menu dialog drawer dropdown-menu form hover-card input input-otp label menubar navigation-menu pagination popover progress radio-group resizable scroll-area select separator sheet sidebar skeleton slider sonner switch table tabs textarea toast toggle toggle-group tooltip
|
|
pnpm install
|