diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d3d5e22..69077afd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,25 @@ All notable changes to CCS will be documented here. Format based on [Keep a Changelog](https://keepachangelog.com/). +## [2.2.2] - 2025-11-03 + +### Fixed +- **Installation Command**: `ccs --install` now works when called via symlinks +- **Directory Resolution**: Added fallback logic to check both development and installation locations + - Checks `$SCRIPT_DIR/.claude` for development (tools/ccs/.claude) + - Checks `$HOME/.ccs/.claude` for installed (~/.ccs/.claude) + - Works regardless of how the script is executed (direct or via symlink) +- **Cross-Platform Consistency**: PowerShell version (ccs.ps1) includes identical fix +- **Error Messages**: Enhanced with clear guidance showing both checked locations + +### Technical Details +- **Files Modified**: + - `ccs`: Added fallback directory checking in install_commands_and_skills() + - `ccs.ps1`: Added identical fallback logic in Install-CommandsAndSkills +- **Root Cause**: Script directory resolution didn't handle symlinks properly +- **Solution**: Simple KISS principle approach - check both possible locations +- **Impact**: No breaking changes, full backward compatibility maintained + ## [2.2.1] - 2025-11-03 ### Changed diff --git a/VERSION b/VERSION index ccbccc3d..b1b25a5f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.2.0 +2.2.2 diff --git a/ccs b/ccs index be7e51a5..e04a5492 100755 --- a/ccs +++ b/ccs @@ -2,7 +2,7 @@ set -euo pipefail # Version (updated by scripts/bump-version.sh) -CCS_VERSION="2.2.0" +CCS_VERSION="2.2.2" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # --- Color/Format Functions --- @@ -33,7 +33,20 @@ CONFIG_FILE="${CCS_CONFIG:-$HOME/.ccs/config.json}" # Installation function for commands and skills install_commands_and_skills() { - local source_dir="$SCRIPT_DIR/.claude" + # Try both possible locations for .claude directory + local source_dir="" + local possible_dirs=( + "$SCRIPT_DIR/.claude" # Development: tools/ccs/.claude + "$HOME/.ccs/.claude" # Installed: ~/.ccs/.claude + ) + + for dir in "${possible_dirs[@]}"; do + if [[ -d "$dir" ]]; then + source_dir="$dir" + break + fi + done + local target_dir="$HOME/.claude" echo "┌─ Installing CCS Commands & Skills" @@ -44,9 +57,15 @@ install_commands_and_skills() { # Check if source directory exists if [[ ! -d "$source_dir" ]]; then echo "|" - msg_error "Source directory not found: $source_dir + msg_error "Source directory not found. -Make sure you're running this from the CCS repository directory." +Checked locations: + - $SCRIPT_DIR/.claude (development) + - $HOME/.ccs/.claude (installed) + +Solution: + 1. If developing: Ensure you're in the CCS repository + 2. If installed: Reinstall CCS with: curl -fsSL ccs.kaitran.ca/install | bash" return 1 fi diff --git a/ccs.ps1 b/ccs.ps1 index 989e3948..ba254609 100644 --- a/ccs.ps1 +++ b/ccs.ps1 @@ -25,12 +25,25 @@ function Write-ErrorMsg { } # Version (updated by scripts/bump-version.sh) -$CcsVersion = "2.2.0" +$CcsVersion = "2.2.2" $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path # Installation function for commands and skills function Install-CommandsAndSkills { - $SourceDir = Join-Path $ScriptDir ".claude" + # Try both possible locations for .claude directory + $SourceDir = $null + $PossibleDirs = @( + (Join-Path $ScriptDir ".claude"), # Development: tools/ccs/.claude + (Join-Path $env:USERPROFILE ".ccs\.claude") # Installed: ~/.ccs/.claude + ) + + foreach ($Dir in $PossibleDirs) { + if (Test-Path $Dir) { + $SourceDir = $Dir + break + } + } + $TargetDir = Join-Path $env:USERPROFILE ".claude" Write-Host "[Installing CCS Commands & Skills]" -ForegroundColor Cyan @@ -39,10 +52,19 @@ function Install-CommandsAndSkills { Write-Host "|" # Check if source directory exists - if (-not (Test-Path $SourceDir)) { + if (-not $SourceDir) { Write-Host "|" - Write-Host "[ERROR] Source directory not found: $SourceDir" -ForegroundColor Red - Write-Host " Make sure you're running this from the CCS repository directory." + $DevelopmentPath = Join-Path $ScriptDir ".claude" + $InstalledPath = Join-Path $env:USERPROFILE ".ccs\.claude" + Write-ErrorMsg "Source directory not found. + +Checked locations: + - $DevelopmentPath (development) + - $InstalledPath (installed) + +Solution: + 1. If developing: Ensure you're in the CCS repository + 2. If installed: Reinstall CCS with: irm ccs.kaitran.ca/install | iex" exit 1 } diff --git a/installers/install.ps1 b/installers/install.ps1 index 3a55e504..fd35a72d 100644 --- a/installers/install.ps1 +++ b/installers/install.ps1 @@ -30,7 +30,7 @@ $InstallMethod = if ($ScriptDir -and ((Test-Path "$ScriptDir\ccs.ps1") -or (Test # IMPORTANT: Update this version when releasing new versions! # This hardcoded version is used for standalone installations (irm | iex) # For git installations, VERSION file is read if available -$CcsVersion = "2.2.0" +$CcsVersion = "2.2.2" # Try to read VERSION file for git installations if ($ScriptDir) { diff --git a/installers/install.sh b/installers/install.sh index 099a2630..2b324e33 100755 --- a/installers/install.sh +++ b/installers/install.sh @@ -31,7 +31,7 @@ fi # IMPORTANT: Update this version when releasing new versions! # This hardcoded version is used for standalone installations (curl | bash) # For git installations, VERSION file is read if available -CCS_VERSION="2.2.0" +CCS_VERSION="2.2.2" # Try to read VERSION file for git installations if [[ -f "$SCRIPT_DIR/VERSION" ]]; then