-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·32 lines (25 loc) · 785 Bytes
/
Copy pathbootstrap.sh
File metadata and controls
executable file
·32 lines (25 loc) · 785 Bytes
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
#!/usr/bin/env bash
set -euo pipefail
repo_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [[ -x "$repo_dir/bin/uboot" ]]; then
exec "$repo_dir/bin/uboot" --config "$repo_dir/configs" "$@"
fi
if command -v go >/dev/null 2>&1; then
cd "$repo_dir"
exec go run ./cmd/uboot --config "$repo_dir/configs" "$@"
fi
if [[ -x "$HOME/.local/bin/go" ]]; then
cd "$repo_dir"
exec "$HOME/.local/bin/go" run ./cmd/uboot --config "$repo_dir/configs" "$@"
fi
if [[ -x "$HOME/.local/opt/go1.26.2/bin/go" ]]; then
cd "$repo_dir"
exec "$HOME/.local/opt/go1.26.2/bin/go" run ./cmd/uboot --config "$repo_dir/configs" "$@"
fi
cat >&2 <<'EOF'
Go is required to run this bootstrap project.
Install one of:
sudo apt install -y golang-go
sudo snap install go --classic
EOF
exit 1