-
Notifications
You must be signed in to change notification settings - Fork 284
fix: improve uninstall wizard cleanup #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1329,6 +1329,41 @@ async def run_uninstall_wizard() -> None: | |
| console.print(f"\n[green]SUCCESS[/green]\n{result['message']}") | ||
| else: | ||
| console.print(f"\n[red]FAILED[/red]\n{result['message']}") | ||
| return | ||
|
|
||
| # Additional cleanup: shell config | ||
| console.print("\n[bold]Additional cleanup:[/bold]") | ||
|
|
||
| # Remove CLAUDE_OPC_DIR from shell config | ||
| for shell_config in [Path.home() / ".zshrc", Path.home() / ".bashrc"]: | ||
| if shell_config.exists(): | ||
| content = shell_config.read_text() | ||
| if "CLAUDE_OPC_DIR" in content: | ||
| lines = content.splitlines() | ||
| cleaned = [ | ||
| line for line in lines | ||
| if "CLAUDE_OPC_DIR" not in line | ||
| and "Continuous-Claude OPC directory" not in line | ||
| ] | ||
| shell_config.write_text("\n".join(cleaned) + "\n") | ||
| console.print(f" [green]OK[/green] Removed CLAUDE_OPC_DIR from {shell_config.name}") | ||
|
|
||
| # Offer to remove TLDR CLI | ||
| if shutil.which("tldr"): | ||
| if Confirm.ask("\n Remove TLDR CLI tool?", default=False): | ||
| import subprocess | ||
|
|
||
| remove_result = subprocess.run( | ||
| ["uv", "tool", "uninstall", "llm-tldr"], | ||
| capture_output=True, | ||
| text=True, | ||
| timeout=30, | ||
| ) | ||
| if remove_result.returncode == 0: | ||
| console.print(" [green]OK[/green] TLDR removed") | ||
| else: | ||
| console.print(" [yellow]WARN[/yellow] Could not remove TLDR") | ||
| console.print(" Remove manually: uv tool uninstall llm-tldr") | ||
|
Comment on lines
+1352
to
+1370
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing error handling for If 🛡️ Proposed fix: wrap in try/except if shutil.which("tldr"):
if Confirm.ask("\n Remove TLDR CLI tool?", default=False):
import subprocess
- remove_result = subprocess.run(
- ["uv", "tool", "uninstall", "llm-tldr"],
- capture_output=True,
- text=True,
- timeout=30,
- )
- if remove_result.returncode == 0:
- console.print(" [green]OK[/green] TLDR removed")
- else:
- console.print(" [yellow]WARN[/yellow] Could not remove TLDR")
+ try:
+ remove_result = subprocess.run(
+ ["uv", "tool", "uninstall", "llm-tldr"],
+ capture_output=True,
+ text=True,
+ timeout=30,
+ )
+ if remove_result.returncode == 0:
+ console.print(" [green]OK[/green] TLDR removed")
+ else:
+ console.print(" [yellow]WARN[/yellow] Could not remove TLDR")
+ console.print(" Remove manually: uv tool uninstall llm-tldr")
+ except (subprocess.TimeoutExpired, OSError) as e:
+ console.print(f" [yellow]WARN[/yellow] Could not remove TLDR: {e}")
console.print(" Remove manually: uv tool uninstall llm-tldr")🤖 Prompt for AI Agents |
||
|
|
||
|
|
||
| async def main(): | ||
|
|
||
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.