Files
ccs/src/commands/install-command.ts
T
kaitranntt e98a92fded fix: address PR #373 review feedback
- postuninstall.js: add file logging for debugging on error
- profile-hook-injector.ts: use 'wx' flag for atomic marker creation
- profile-hook-injector.ts: include parse error message in debug log
- install-command.ts: use actual counts for consistent semantics
- Windows tests: align Section 7 with per-profile hook architecture
2026-01-25 22:02:25 -05:00

64 lines
1.8 KiB
TypeScript

/**
* Install/Uninstall Command Handlers
*
* Handle --install and --uninstall commands for CCS.
*/
import { info, ok, color, box, initUI } from '../utils/ui';
import { uninstallWebSearchHook } from '../utils/websearch';
import { ClaudeSymlinkManager } from '../utils/claude-symlink-manager';
/**
* Handle install command
*/
export async function handleInstallCommand(): Promise<void> {
await initUI();
console.log('');
console.log(info('Feature not available'));
console.log('');
console.log('The --install flag is currently under development.');
console.log('.claude/ integration testing is not complete.');
console.log('');
console.log(`For updates: ${color('https://github.com/kaitranntt/ccs/issues', 'path')}`);
console.log('');
process.exit(0);
}
/**
* Handle uninstall command
*/
export async function handleUninstallCommand(): Promise<void> {
await initUI();
console.log('');
console.log(box('Uninstalling CCS', { borderColor: 'cyan' }));
console.log('');
let removed = 0;
// 1. Remove WebSearch hook file + migration marker (does NOT touch global settings.json)
const hookRemoved = uninstallWebSearchHook();
if (hookRemoved) {
console.log(ok('Removed WebSearch hook'));
removed += 1; // Count as 1 item (the hook file)
}
// 2. Remove symlinks from ~/.claude/
const symlinkManager = new ClaudeSymlinkManager();
const symlinksRemoved = symlinkManager.uninstall();
removed += symlinksRemoved; // Add actual count of symlinks removed
// 3. Summary
console.log('');
if (removed > 0) {
console.log(ok('Uninstall complete!'));
console.log('');
console.log(info('~/.ccs/ directory preserved'));
console.log(info('To reinstall: ccs --install'));
} else {
console.log(info('Nothing to uninstall'));
}
console.log('');
process.exit(0);
}