mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-13 22:15:33 +00:00
This commit fixes version management and argument parsing issues across both Windows and Linux/macOS platforms, achieving 100% test coverage. Changes: - Add VERSION file installation to both installers (install.sh, install.ps1) - Fix version/help command detection when using 'powershell -File' syntax - Rename PowerShell param from $Profile to $ProfileOrFlag for clarity - Add $FirstArg detection to check both ProfileOrFlag and RemainingArgs - Create comprehensive edge case test suites for both platforms: * tests/edge-cases.ps1 - 31 tests for Windows (100% pass) * tests/edge-cases.sh - 37 tests for Linux/macOS (100% pass) - Fix multiline regex matching in tests for error messages - Update test expectations to match platform-specific behavior - Reorganize project structure: * Move installers to installers/ directory * Add scripts/ directory for version management * Add config/ directory for configuration templates * Add docs/ directory for documentation Test Results: - Windows (PowerShell): 31/31 tests passing (100%) - Linux/macOS (Bash): 37/37 tests passing (100%) Breaking Changes: None - Installers moved but GitHub URLs updated in README files - All existing functionality preserved Co-authored-by: Claude Code <claude@anthropic.com>
40 lines
953 B
Bash
Executable File
40 lines
953 B
Bash
Executable File
#!/usr/bin/env bash
|
||
set -euo pipefail
|
||
|
||
echo "Uninstalling ccs..."
|
||
echo ""
|
||
|
||
# Remove symlink
|
||
if [[ -L "$HOME/.local/bin/ccs" ]]; then
|
||
rm "$HOME/.local/bin/ccs"
|
||
echo "✓ Removed: $HOME/.local/bin/ccs"
|
||
elif [[ -f "$HOME/.local/bin/ccs" ]]; then
|
||
rm "$HOME/.local/bin/ccs"
|
||
echo "✓ Removed: $HOME/.local/bin/ccs"
|
||
else
|
||
echo "ℹ No ccs binary found at $HOME/.local/bin/ccs"
|
||
fi
|
||
|
||
# Remove uninstall symlink
|
||
if [[ -L "$HOME/.local/bin/ccs-uninstall" ]]; then
|
||
rm "$HOME/.local/bin/ccs-uninstall"
|
||
echo "✓ Removed: $HOME/.local/bin/ccs-uninstall"
|
||
fi
|
||
|
||
# Ask about ~/.ccs directory
|
||
if [[ -d "$HOME/.ccs" ]]; then
|
||
read -p "Remove CCS directory ~/.ccs? This includes config and profiles. (y/N) " -n 1 -r
|
||
echo
|
||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
||
rm -rf "$HOME/.ccs"
|
||
echo "✓ Removed: $HOME/.ccs"
|
||
else
|
||
echo "ℹ Kept: $HOME/.ccs"
|
||
fi
|
||
else
|
||
echo "ℹ No CCS directory found at $HOME/.ccs"
|
||
fi
|
||
|
||
echo ""
|
||
echo "✓ Uninstall complete!"
|