perf: start.sh增加sudo

v2-dev
xiaojunnuo 2025-09-08 23:01:45 +08:00
parent 40475e02ec
commit b7271d7a46
1 changed files with 6 additions and 6 deletions

View File

@ -25,30 +25,30 @@ done
echo "安装pnpm, 前提是已经安装了nodejs" echo "安装pnpm, 前提是已经安装了nodejs"
npm install -g pnpm --registry https://registry.npmmirror.com sudo npm install -g pnpm --registry https://registry.npmmirror.com
echo "安装依赖" echo "安装依赖"
pnpm install --registry https://registry.npmmirror.com sudo pnpm install --registry https://registry.npmmirror.com
echo "开始构建" echo "开始构建"
echo "构建certd-client" echo "构建certd-client"
export NODE_OPTIONS=--max-old-space-size=32768 export NODE_OPTIONS=--max-old-space-size=32768
cd packages/ui/certd-client cd packages/ui/certd-client
pnpm run build sudo pnpm run build
cp -r dist/* ../certd-server/public cp -r dist/* ../certd-server/public
echo "构建certd-server" echo "构建certd-server"
cd ../certd-server cd ../certd-server
pnpm run build sudo pnpm run build
echo "构建完成" echo "构建完成"
echo "启动服务" echo "启动服务"
# 前台运行 # 前台运行
if [ $confirmNohup != "y" ]; then if [ $confirmNohup != "y" ]; then
echo "当前运行模式为前台运行ctrl+c或者关闭ssh将会停止运行" echo "当前运行模式为前台运行ctrl+c或者关闭ssh将会停止运行"
pnpm run start sudo pnpm run start
else else
echo "当前运行模式为后台运行可以通过tail -f ./certd.log 命令查看日志" echo "当前运行模式为后台运行可以通过tail -f ./certd.log 命令查看日志"
nohup pnpm run start > certd.log & nohup sudo pnpm run start > certd.log &
fi fi