-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·141 lines (118 loc) · 3.04 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·141 lines (118 loc) · 3.04 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!/usr/bin/env bash
set -euo pipefail
REPO="Aeres-u99/codeatlas"
BINARY="codeatlas"
if ! command -v curl >/dev/null 2>&1; then
echo "Error: curl is required."
exit 1
fi
OS="$(uname -s | tr '[:upper:]' '[:lower:]')"
case "$OS" in
linux|darwin) ;;
*)
echo "Unsupported operating system: $OS"
exit 1
;;
esac
ARCH="$(uname -m)"
case "$ARCH" in
x86_64|amd64)
ARCH="amd64"
;;
arm64|aarch64)
ARCH="arm64"
;;
*)
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac
ASSET_NAME="${BINARY}-${OS}-${ARCH}"
echo "==> Looking for latest release..."
DOWNLOAD_URL=$(
curl -fsSL "https://api.github.com/repos/${REPO}/releases/latest" |
grep "browser_download_url" |
grep "\".*${ASSET_NAME}\"" |
sed -E 's/.*"([^"]+)".*/\1/' |
head -n1
)
if [ -z "$DOWNLOAD_URL" ]; then
echo "Unable to locate release asset:"
echo " $ASSET_NAME"
exit 1
fi
TMP="$(mktemp)"
echo "==> Downloading ${ASSET_NAME}..."
curl -fL "$DOWNLOAD_URL" -o "$TMP"
chmod +x "$TMP"
INSTALL_DIR="$HOME/.local/bin"
mkdir -p "$INSTALL_DIR"
mv "$TMP" "$INSTALL_DIR/$BINARY"
chmod +x "$INSTALL_DIR/$BINARY"
echo
echo "✔ CodeAtlas installed successfully!"
echo
echo "Installed to:"
echo " $INSTALL_DIR/$BINARY"
mkdir -p "$HOME/.codeatlas/skills"
if ! command -v jq >/dev/null 2>&1; then
echo "Error: jq is required to install CodeAtlas skills."
exit 1
fi
mkdir -p "$HOME/.codeatlas/skills"
curl -fsSL "https://api.github.com/repos/Aeres-u99/codeatlas/contents/.codeatlas/skills?ref=master" \
| jq -r '.[].download_url' \
| while read -r url; do
curl -fsSL "$url" -o "$HOME/.codeatlas/skills/$(basename "$url")"
done
for tool in ".claude" ".codex" ".gemini"; do
SKILLS_DIR="$HOME/$tool/skills"
if [ ! -d "$SKILLS_DIR" ]; then
echo "⚠ $tool/skills not found, skipping."
continue
fi
rm -f "$SKILLS_DIR/codeatlas"
ln -s "$HOME/.codeatlas/skills" "$SKILLS_DIR/codeatlas"
echo "✓ Linked CodeAtlas skills to $tool"
done
echo
echo "✔ CodeAtlas Skills installed successfully!"
echo
echo "Installed to:"
echo " $HOME/.codeatlas/skills"
echo
echo "Linked to:"
[ -d "$HOME/.claude" ] && echo " ~/.claude/skills"
[ -d "$HOME/.codex" ] && echo " ~/.codex/skills"
[ -d "$HOME/.gemini" ] && echo " ~/.gemini/skills"
case ":$PATH:" in
*":$INSTALL_DIR:"*)
;;
*)
echo
echo "$INSTALL_DIR is not on your PATH."
echo
SHELL_NAME="$(basename "${SHELL:-}")"
case "$SHELL_NAME" in
zsh)
RC="$HOME/.zshrc"
;;
bash)
RC="$HOME/.bashrc"
;;
fish)
RC="$HOME/.config/fish/config.fish"
;;
*)
RC="your shell configuration file"
;;
esac
echo "Add the following line to $RC:"
echo
echo 'export PATH="$HOME/.local/bin:$PATH"'
;;
esac
echo
echo "Verify installation:"
echo " codeatlas --help"
echo