-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
39 lines (33 loc) · 1.19 KB
/
install.sh
File metadata and controls
39 lines (33 loc) · 1.19 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
#!/bin/sh
# Copyright (c) 2026 Stuart Bell
# Licensed under the MIT License. See https://github.com/stu-bell/devcontainer-features/blob/main/LICENSE for license information.
set -e
. ./util.sh
# Make sure there isn't already an installation of the tool
remote_user_has_command claude && {
version=$(remote_user_run 'claude -v')
echo "Claude Code $version is already installed"
exit 0
}
# dependencies
has_command curl || {
echored "ERROR: This feature requires curl to be installed. Install with devcontainer feature ghcr.io/devcontainers/features/common-utils"
exit 1
}
# alpine dependencies
ensure_bash_on_alpine
if os_alpine ; then
apk add --no-cache libgcc libstdc++ ripgrep
fi
# install Claude Code
echo "Installing Claude Code via https://claude.ai/install.sh"
echo ""
echo "Note: Claude install script does not output progress..."
# Run the install as the remote user, as script installs locally
remote_user_run 'curl -fsSL https://claude.ai/install.sh | bash'
add_to_user_profiles 'export PATH="$HOME/.local/bin:$PATH"'
# Verify installation
remote_user_has_command claude && {
version=$(remote_user_run 'claude -v')
echo "Claude Code $version installed successfully"
}