File tree Expand file tree Collapse file tree 1 file changed +48
-2
lines changed
Expand file tree Collapse file tree 1 file changed +48
-2
lines changed Original file line number Diff line number Diff line change 22set -eu
33
44# Configurable variables:
5- # ASSET_NAME - name of the release asset to download (default Aio-linux-amd64 )
5+ # ASSET_NAME - name of the release asset to download (auto-detect by default )
66# REPO - owner/repo (default uerax/all-in-one-bot)
77# RELEASE_URL - optional full URL to download (overrides REPO/ASSET_NAME)
88# CONFIG_PATH - path to config file passed to binary
99
10- ASSET_NAME=${ASSET_NAME:- Aio-linux-amd64}
10+ # Auto-detect platform and set default asset name
11+ ARCH=$( uname -m)
12+ OS=$( uname -s)
13+ case " $OS " in
14+ Linux)
15+ case " $ARCH " in
16+ x86_64)
17+ DEFAULT_ASSET=" Aio-linux-amd64"
18+ ;;
19+ aarch64|arm64)
20+ DEFAULT_ASSET=" Aio-linux-arm64"
21+ ;;
22+ * )
23+ echo " Unsupported Linux architecture: $ARCH " >&2
24+ exit 1
25+ ;;
26+ esac
27+ ;;
28+ Darwin)
29+ case " $ARCH " in
30+ arm64)
31+ DEFAULT_ASSET=" Aio-darwin-arm64"
32+ ;;
33+ * )
34+ echo " Unsupported macOS architecture: $ARCH " >&2
35+ exit 1
36+ ;;
37+ esac
38+ ;;
39+ MINGW64* |MSYS* )
40+ case " $ARCH " in
41+ x86_64)
42+ DEFAULT_ASSET=" Aio-windows-amd64.exe"
43+ ;;
44+ * )
45+ echo " Unsupported Windows architecture: $ARCH " >&2
46+ exit 1
47+ ;;
48+ esac
49+ ;;
50+ * )
51+ echo " Unsupported OS: $OS " >&2
52+ exit 1
53+ ;;
54+ esac
55+
56+ ASSET_NAME=${ASSET_NAME:- $DEFAULT_ASSET }
1157REPO=${REPO:- uerax/ all-in-one-bot}
1258RELEASE_URL=${RELEASE_URL:- }
1359CONFIG_PATH=${CONFIG_PATH:-/ usr/ local/ etc/ aio/ all-in-one-bot.yml}
You can’t perform that action at this time.
0 commit comments