ario_server/script/generate.sh
shanshanzhong c582087c0f
Some checks failed
Build docker and publish / build (20.15.1) (push) Failing after 6m27s
refactor: 更新项目引用路径从perfect-panel/ppanel-server到perfect-panel/server
feat: 添加版本和构建时间变量
fix: 修正短信队列类型注释错误
style: 清理未使用的代码和测试文件
docs: 更新安装文档中的下载链接
chore: 迁移数据库脚本添加日志和订阅配置
2025-10-13 01:33:03 -07:00

54 lines
2.1 KiB
Bash
Executable File

#!/bin/bash
OS_TYPE=$(uname)
ARCH_TYPE=$(uname -m)
if [[ "$OS_TYPE" == "Linux" ]]; then
echo "The current operating system is Linux"
if [[ "$ARCH_TYPE" == "x86_64" ]]; then
echo "Format api file"
./generate/gopure-linux-amd64 api format --dir ./apis
echo "Architecture: amd64"
./generate/gopure-linux-amd64 api go -api *.api -dir . -style goZero
elif [[ "$ARCH_TYPE" == "aarch64" ]]; then
echo "Format api file"
./generate/gopure-linux-arm64 api format --dir ./apis
echo "Architecture: arm64"
./generate/gopure-linux-arm64 api go -api *.api -dir . -style goZero
else
echo "Unrecognized architecture: $ARCH_TYPE"
fi
elif [[ "$OS_TYPE" == "Darwin" ]]; then
echo "The current operating system is macOS"
if [[ "$ARCH_TYPE" == "x86_64" ]]; then
echo "Format api file"
./generate/gopure-darwin-amd64 api format --dir ./apis
echo "Architecture: amd64"
./generate/gopure-darwin-amd64 api go -api *.api -dir . -style goZero
elif [[ "$ARCH_TYPE" == "arm64" ]]; then
echo "Format api file"
./generate/gopure-darwin-arm64 api format --dir ./apis
echo "Architecture: arm64"
./generate/gopure-darwin-arm64 api go -api *.api -dir . -style goZero
else
echo "Unrecognized architecture: $ARCH_TYPE"
fi
elif [[ "$OS_TYPE" == "CYGWIN"* || "$OS_TYPE" == "MINGW"* ]]; then
echo "The current operating system is Windows"
if [[ "$ARCH_TYPE" == "x86_64" ]]; then
echo "Format api file"
./generate/gopure-amd64.exe api format --dir ./apis
echo "Architecture: amd64"
./generate/gopure-amd64.exe api go -api *.api -dir . -style goZero
elif [[ "$ARCH_TYPE" == "arm64" ]]; then
echo "Format api file"
./generate/gopure-arm64.exe api format --dir ./apis
echo "Architecture: arm64"
./generate/gopure-arm64.exe api go -api *.api -dir . -style goZero
else
echo "Unrecognized architecture: $ARCH_TYPE"
fi
else
echo "Unrecognized operating system: $OS_TYPE"
fi