From 71ceeb490d07b9923a627d60c16b7bd2a42c5859 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 31 Mar 2025 14:16:46 +0200 Subject: [PATCH] Update fumadocs-install.sh --- install/fumadocs-install.sh | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/install/fumadocs-install.sh b/install/fumadocs-install.sh index c89194e..6cb4359 100644 --- a/install/fumadocs-install.sh +++ b/install/fumadocs-install.sh @@ -16,7 +16,8 @@ update_os msg_info "Installing Dependencies" $STD apt-get install -y \ gnupg \ - ca-certificates + ca-certificates \ + expect msg_ok "Installed Dependencies" msg_info "Installing Node.js" @@ -25,19 +26,30 @@ curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dea echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" >/etc/apt/sources.list.d/nodesource.list $STD apt-get update $STD apt-get install -y nodejs -$STD npm install -g bun +$STD npm install -g pnpm msg_ok "Installed Node.js" msg_info "Installing Fumadocs" temp_file=$(mktemp) RELEASE=$(curl -s https://api.github.com/repos/fuma-nama/fumadocs/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') -export NODE_OPTIONS="--max-old-space-size=2048" +export NODE_OPTIONS="--max-old-space-size=4096" wget -q https://github.com/fuma-nama/fumadocs/archive/refs/tags/${RELEASE}.tar.gz -O $temp_file -tar zxf $temp_file -mv fumadocs-* "${PWD}/fumadocs" +tar -xzf $temp_file +mv fumadocs-* "/opt/fumadocs" cd /opt/fumadocs -$STD bun install -bun create fumadocs-app +$STD pnpm install +spawn pnpm create fumadocs-app +expect "Project name" +send "my-app\r" +expect "Choose a template" +send "Next.js: Fumadocs MDX\r" +expect "Use \`/src\` directory?" +send "No\r" +expect "Add default ESLint configuration?" +send "No\r" +expect "Do you want to install packages automatically?*" +send "Yes\r" +expect eof echo "${RELEASE}" >/opt/${APPLICATION}_version.txt msg_ok "Installed Fumadocs" @@ -49,7 +61,7 @@ After=network.target [Service] WorkingDirectory=/opt/fumadocs -ExecStart=/usr/bin/bun run dev +ExecStart=/usr/bin/pnpm run dev Restart=always [Install] @@ -61,6 +73,7 @@ motd_ssh customize msg_info "Cleaning up" +rm -f $temp_file $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned"