-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathinstall
More file actions
33 lines (27 loc) · 1.1 KB
/
install
File metadata and controls
33 lines (27 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
set -euo pipefail
# One-line installer entrypoint (for: curl -fsSL .../install | bash)
# Notes:
# - This file is only a bootstrap; the real installer logic lives in install.sh.
# - Override repo/ref via env vars (useful for forks or pinning versions):
# VG_INSTALL_REPO=owner/repo (default: inkdust2021/VibeGuard)
# VG_INSTALL_REF=ref (default: main; can be v1.2.3 or a commit SHA)
have() { command -v "$1" >/dev/null 2>&1; }
VG_INSTALL_REPO="${VG_INSTALL_REPO:-inkdust2021/VibeGuard}"
VG_INSTALL_REF="${VG_INSTALL_REF:-main}"
VG_INSTALL_PATH="${VG_INSTALL_PATH:-install.sh}"
url="https://raw.githubusercontent.com/${VG_INSTALL_REPO}/${VG_INSTALL_REF}/${VG_INSTALL_PATH}"
# If install.sh exists in the current directory (e.g. repo cloned), prefer the local script to avoid re-downloading.
if [[ -f "./install.sh" ]]; then
bash "./install.sh" "$@"
exit 0
fi
if have curl; then
curl -fsSL "${url}" | bash -s -- "$@"
elif have wget; then
wget -qO- "${url}" | bash -s -- "$@"
else
echo "错误:缺少依赖 curl 或 wget" >&2
echo "Error: missing curl or wget" >&2
exit 1
fi