Spaces:
Running
Running
set -e | |
echo "开始安装 Remix..." | |
# 使用 npx 来运行 create-remix | |
npx create-remix@latest ${REMIX_NAME} --yes --no-install --no-git-init | |
cp ${HOMEDIR}/ecosystem.config.cjs ${HOMEDIR}/${REMIX_NAME}/ecosystem.config.cjs | |
# 进入 Remix 项目目录 | |
cd ${HOMEDIR}/${REMIX_NAME} | |
# 安装依赖并构建 | |
pnpm install | |
pnpm add react react-dom @remix-run/node @remix-run/react | |
pnpm add @types/node @types/react @types/react-dom --save-dev | |
# 复制 sshx 路由文件 | |
cp ${HOMEDIR}/sshx.tsx ${HOMEDIR}/${REMIX_NAME}/app/routes/sshx.tsx | |
# 构建应用 | |
pnpm run build | |
# 返回 HOMEDIR | |
cd ${HOMEDIR} | |
echo "Remix 安装完成,并添加了 SSHX 控制页面" | |