-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup
More file actions
executable file
·67 lines (54 loc) · 1.48 KB
/
Copy pathsetup
File metadata and controls
executable file
·67 lines (54 loc) · 1.48 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env bash
set -euo pipefail
# Amp Orbs setup
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$repo_root"
export DISABLE_TELEMETRY=1
export MISE_EXPERIMENTAL=true
export MISE_HTTP_TIMEOUT=120
if ! command -v shellcheck >/dev/null 2>&1; then
echo "Installing system packages"
apt=(apt-get)
if ((EUID != 0)); then
if ! command -v sudo >/dev/null 2>&1; then
echo "shellcheck is required, but setup cannot run apt-get as root" >&2
exit 1
fi
apt=(sudo apt-get)
fi
"${apt[@]}" update
"${apt[@]}" install -y shellcheck
fi
echo "Installing mise"
if command -v mise >/dev/null 2>&1; then
mise_bin="$(command -v mise)"
else
installer="$(mktemp)"
trap 'rm -f "$installer"' EXIT
curl --fail --silent --show-error --location https://mise.run --output "$installer"
bash "$installer"
mise_bin="$HOME/.local/bin/mise"
fi
if [[ ! -x "$mise_bin" ]]; then
echo "mise was not installed at $mise_bin" >&2
exit 1
fi
profile_marker="# skills orb setup: activate mise"
if ! grep -Fqx "$profile_marker" "$HOME/.bash_profile" 2>/dev/null; then
cat >>"$HOME/.bash_profile" <<EOF
$profile_marker
if [[ -x "$mise_bin" ]]; then
eval "\$("$mise_bin" activate bash)"
fi
EOF
fi
echo "Installing repository toolchains"
"$mise_bin" trust "$repo_root/mise.toml"
"$mise_bin" install
echo "Installing locked dependencies"
"$mise_bin" exec -- bun install --frozen-lockfile
"$mise_bin" exec -- uv sync --frozen
if [[ ! -f .env ]]; then
cp -- .env.example .env
fi
echo "Orb setup complete"