elder-yudao-pro/deploy/local/prepare-ui.sh

21 lines
578 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
set -euo pipefail
# shellcheck disable=SC1091
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/common.sh"
UI_DIR="$REPO_DIR/yudao-ui-admin-vue3"
[[ -f "$UI_DIR/package.json" ]] || { echo "缺少前端目录: $UI_DIR" >&2; exit 1; }
if command -v pnpm >/dev/null 2>&1; then
PNPM="$(command -v pnpm)"
elif command -v corepack >/dev/null 2>&1; then
PNPM="corepack pnpm"
else
echo '未找到 pnpm。请安装 pnpm 8,或启用 Node.js Corepack。' >&2
exit 1
fi
cd "$UI_DIR"
$PNPM install --frozen-lockfile
echo '前端依赖已准备完成。'