Add cleanup script
This commit is contained in:
parent
c387a7a365
commit
8171760807
1 changed files with 22 additions and 0 deletions
22
force-cleanup.sh
Executable file
22
force-cleanup.sh
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
# opencode-container-cleanup.sh - Complete cleanup script for OpenCode container
|
||||
|
||||
set -e
|
||||
|
||||
# Stop and remove all opencode containers
|
||||
echo "Stopping and removing opencode containers..."
|
||||
docker ps -q --filter "name=oc-" | xargs -r docker stop
|
||||
docker ps -a -q --filter "name=oc-" | xargs -r docker rm -f
|
||||
|
||||
# Remove the Docker image
|
||||
echo "Removing opencode-container image..."
|
||||
docker rmi opencode-container:latest 2>/dev/null || true
|
||||
|
||||
# Remove entire opencode-container directory
|
||||
CONTAINER_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/opencode-container"
|
||||
if [ -d "$CONTAINER_DIR" ]; then
|
||||
echo "Removing ~/.local/share/opencode-container directory..."
|
||||
rm -rf "$CONTAINER_DIR"
|
||||
fi
|
||||
|
||||
echo "Complete cleanup finished!"
|
||||
Loading…
Add table
Add a link
Reference in a new issue