| #!/bin/bash |
| |
| |
|
|
| set -euo pipefail |
|
|
| |
| cd "$CLAUDE_PROJECT_DIR" || exit 1 |
|
|
| echo "Loading project context..." |
|
|
| |
| if [ -f "package.json" ]; then |
| echo "π¦ Node.js project detected" |
| echo "export PROJECT_TYPE=nodejs" >> "$CLAUDE_ENV_FILE" |
|
|
| |
| if [ -f "tsconfig.json" ]; then |
| echo "export USES_TYPESCRIPT=true" >> "$CLAUDE_ENV_FILE" |
| fi |
|
|
| elif [ -f "Cargo.toml" ]; then |
| echo "π¦ Rust project detected" |
| echo "export PROJECT_TYPE=rust" >> "$CLAUDE_ENV_FILE" |
|
|
| elif [ -f "go.mod" ]; then |
| echo "πΉ Go project detected" |
| echo "export PROJECT_TYPE=go" >> "$CLAUDE_ENV_FILE" |
|
|
| elif [ -f "pyproject.toml" ] || [ -f "setup.py" ]; then |
| echo "π Python project detected" |
| echo "export PROJECT_TYPE=python" >> "$CLAUDE_ENV_FILE" |
|
|
| elif [ -f "pom.xml" ]; then |
| echo "β Java (Maven) project detected" |
| echo "export PROJECT_TYPE=java" >> "$CLAUDE_ENV_FILE" |
| echo "export BUILD_SYSTEM=maven" >> "$CLAUDE_ENV_FILE" |
|
|
| elif [ -f "build.gradle" ] || [ -f "build.gradle.kts" ]; then |
| echo "β Java/Kotlin (Gradle) project detected" |
| echo "export PROJECT_TYPE=java" >> "$CLAUDE_ENV_FILE" |
| echo "export BUILD_SYSTEM=gradle" >> "$CLAUDE_ENV_FILE" |
|
|
| else |
| echo "β Unknown project type" |
| echo "export PROJECT_TYPE=unknown" >> "$CLAUDE_ENV_FILE" |
| fi |
|
|
| |
| if [ -f ".github/workflows" ] || [ -f ".gitlab-ci.yml" ] || [ -f ".circleci/config.yml" ]; then |
| echo "export HAS_CI=true" >> "$CLAUDE_ENV_FILE" |
| fi |
|
|
| echo "Project context loaded successfully" |
| exit 0 |
|
|