#!/bin/bash cd doc/ # 检查 http-server 是否已安装 if ! command -v http-server &> /dev/null; then echo "正在安装 http-server..." npm install -g http-server fi # 启动 http-server http-server