Skip to content

Commit 113e4c7

Browse files
seidlrclaude
andcommitted
feat: Migrate installer from Bash to Python with improved cross-platform support
This PR introduces a complete rewrite of the installation system from Bash to Python, providing better cross-platform compatibility and enhanced functionality. Key Changes: - **Python-based installer**: Replaced install.sh with install.py for better error handling and cross-platform support - **Modular architecture**: Split installer into focused modules (dependencies, devcontainer, downloads, env_setup, files, migration, shell_config, ui, utils) - **Bash 3.2 compatibility**: Updated file_checker_python.sh to work with macOS default bash (3.2) by replacing associative arrays with simple variables - **Improved user experience**: Better progress tracking, error messages, and interactive prompts - **Updated documentation**: Modified README.md to reflect the new Python-based installation command The new installer maintains all existing functionality while providing a more robust and maintainable codebase. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 8a22cca commit 113e4c7

14 files changed

Lines changed: 2300 additions & 15 deletions

.claude/hooks/file_checker_python.sh

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,29 @@ fi
2828
file_abs_path=$(realpath "$files")
2929

3030
# Define tools with global paths (installed via uv tool install)
31-
declare -A TOOLS=(
32-
[ruff]="$(command -v ruff 2>/dev/null || true)"
33-
[basedpyright]="$(command -v basedpyright 2>/dev/null || true)"
34-
[mypy]="$(command -v mypy 2>/dev/null || true)"
35-
)
31+
# Using simple variables instead of associative arrays for bash 3.2 compatibility
32+
TOOL_RUFF="$(command -v ruff 2>/dev/null || true)"
33+
TOOL_BASEDPYRIGHT="$(command -v basedpyright 2>/dev/null || true)"
34+
TOOL_MYPY="$(command -v mypy 2>/dev/null || true)"
3635

3736
# Exit if no tools found
38-
[[ -z ${TOOLS[ruff]} && -z ${TOOLS[basedpyright]} && -z ${TOOLS[mypy]} ]] && exit 0
37+
[[ -z $TOOL_RUFF && -z $TOOL_BASEDPYRIGHT && -z $TOOL_MYPY ]] && exit 0
3938

4039
# Auto-format before checks
41-
if [[ -x ${TOOLS[ruff]} ]]; then
42-
${TOOLS[ruff]} check --select I,RUF022 --fix "$files" >/dev/null 2>&1 || true
43-
${TOOLS[ruff]} format "$files" >/dev/null 2>&1 || true
40+
if [[ -x $TOOL_RUFF ]]; then
41+
$TOOL_RUFF check --select I,RUF022 --fix "$files" >/dev/null 2>&1 || true
42+
$TOOL_RUFF format "$files" >/dev/null 2>&1 || true
4443
fi
4544

4645
# Run tool check and store results
4746
run_check() {
4847
local tool=$1
49-
local bin=${TOOLS[$tool]}
48+
local bin
49+
case $tool in
50+
ruff) bin=$TOOL_RUFF ;;
51+
basedpyright) bin=$TOOL_BASEDPYRIGHT ;;
52+
mypy) bin=$TOOL_MYPY ;;
53+
esac
5054
[[ ! -x $bin ]] && return 1
5155

5256
case $tool in
@@ -121,11 +125,19 @@ for diag in data.get('generalDiagnostics', []):
121125

122126
# Run all checks
123127
has_issues=false
124-
declare -A results
128+
# Using delimited string instead of associative array for bash 3.2 compatibility
129+
results_ruff=""
130+
results_basedpyright=""
131+
results_mypy=""
132+
125133
for tool in ruff basedpyright mypy; do
126134
if run_check "$tool"; then
127135
has_issues=true
128-
results[$tool]="$output"
136+
case $tool in
137+
ruff) results_ruff="$output" ;;
138+
basedpyright) results_basedpyright="$output" ;;
139+
mypy) results_mypy="$output" ;;
140+
esac
129141
fi
130142
done
131143

@@ -136,8 +148,12 @@ if [[ $has_issues == true ]]; then
136148
echo "" >&2
137149

138150
for tool in ruff basedpyright mypy; do
139-
if [[ -n ${results[$tool]} ]]; then
140-
output="${results[$tool]}"
151+
case $tool in
152+
ruff) output="$results_ruff" ;;
153+
basedpyright) output="$results_basedpyright" ;;
154+
mypy) output="$results_mypy" ;;
155+
esac
156+
if [[ -n $output ]]; then
141157
display_result "$tool"
142158
fi
143159
done

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Start shipping systematically with Spec-Driven Development, Skills, TDD, Semanti
2323
Run this shell command in **any project directory** for a **fresh install** or to **update to the latest version**:
2424

2525
```bash
26-
curl -sSL https://raw.githubusercontent.com/maxritter/claude-codepro/v2.3.11/scripts/install.sh | bash
26+
curl -sSL https://raw.githubusercontent.com/maxritter/claude-codepro/main/scripts/install.py | python3 -
2727
```
2828

2929
**Recommended:** Install via Dev Container for complete isolation from your host system. The installer will offer to set up the dev container configuration automatically.

0 commit comments

Comments
 (0)