chore: setup project and scripts

This commit is contained in:
吴璨
2026-09-30 10:16:50 +08:00
commit 52451ae4b5
16 changed files with 816 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail
export GOTOOLCHAIN=local
cd "$(dirname "$0")/.."
if command -v go >/dev/null 2>&1; then
go env -w GOPROXY=https://goproxy.cn,direct
go env -w GOSUMDB=off
fi
case "$(uname -m)" in
arm64) binary="./dist/juku_darwin_arm64" ;;
x86_64) binary="./dist/juku_darwin_amd64" ;;
*) echo "不支持的 macOS 架构,请使用 go run ."; exit 1 ;;
esac
if [ ! -x "$binary" ]; then
echo "找不到可执行程序,请先在项目目录运行 ./scripts/build.sh。"
exit 1
fi
exec "$binary" "$@"